<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新)]]></title><description><![CDATA[<blockquote>
<p dir="auto"><strong>發布板塊</strong>：Hermes Agent<br />
<strong>作者</strong>：YDM (昌哥)  / Hermes 女秘書<br />
<strong>適配硬體</strong>：雙 NVIDIA RTX 5070 Ti 16GB (32GB VRAM) + Windows 10 實體機（跑 Qwen llama.cpp）+ VirtualBox Ubuntu 26.04 VM（跑 Hermes Agent）<br />
<strong>主力模型</strong>：100% 本地離線運行 <code>Qwen3.8 27B (UD-Q5_K_XL 量化)</code>，零雲端 API 依賴<br />
<strong>核心成果</strong>：<strong>本地全套回歸測試 85/85 項 100% PASS（0.228 秒），開源庫提取之 6 大能力驗證與 31 項安全治理測試 100% 可重現</strong><br />
<strong>核心宗旨</strong>：<strong>不外掛額外 Agent，直接對 Hermes 本體進行八層原生架構升級！</strong><br />
<strong>文章定位</strong>：本文聚焦<strong>架構思路、工程實踐與經驗沉澱</strong>，分享設計決策與踩坑過程。</p>
</blockquote>
<hr />
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4e2.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--loudspeaker" style="height:23px;width:auto;vertical-align:middle" title="📢" alt="📢" /> 2026-09-05 開源！Hermes Hybrid Core v2.3 (PROD-READY)</h2>
<p dir="auto">這套在本地雙 5070 Ti 上經過實戰驗證的八層自主閉環架構，現已將極速加速核心與確定性治理 SDK <strong>正式開源</strong>！</p>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f449.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--point_right" style="height:23px;width:auto;vertical-align:middle" title="👉" alt="👉" /> <strong>GitHub 開源倉庫傳送門</strong>：<a href="https://github.com/ydmjfk/hermes-hybrid-core" rel="nofollow ugc">https://github.com/ydmjfk/hermes-hybrid-core</a></p>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f680.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--rocket" style="height:23px;width:auto;vertical-align:middle" title="🚀" alt="🚀" /> 9/5 最新升級亮點（相較於本文初版）：</h3>
<ol>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--zap" style="height:23px;width:auto;vertical-align:middle" title="⚡" alt="⚡" /> <strong>極速三重響應層</strong>：
<ul>
<li><strong>&lt; 5ms 語意快取直出（Semantic Cache）</strong>：高頻查詢由記憶體命中直出（&lt; 5ms），省去重複調用大模型的 GPU 算力開銷，內建自動脫敏與防快取投毒。</li>
<li><strong>&lt; 50ms 骨架秒回流式器（Skeleton Streamer）</strong>：即時輸出結構化進度模板，大幅改善首字等待體感。</li>
<li><strong>0.01ms 樂觀平行預取（Speculative Prefetch）</strong>：底層 I/O 查詢平行預跑，縮減工具等待時間。</li>
</ul>
</li>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--shield" style="height:23px;width:auto;vertical-align:middle" title="🛡" alt="🛡" />️ <strong>程式碼級五重安全防禦機制（PROD-READY）</strong>：
<ul>
<li><strong>路徑防遍歷</strong>：32-hop 符號連結迴圈防護、Unicode NFKC 正規化、阻擋 28+ 種敏感檔案與目錄洩漏。</li>
<li><strong>SQL 注入防禦</strong>：五層安全防禦架構，有效阻斷多語句堆疊與高危 PRAGMA 指令。</li>
<li><strong>ReDoS 零回溯</strong>：Fast Path 中文意圖比對重構為 $O(N)$ 詞組演算法，避免正則貪婪回溯導致 CPU 飆高。</li>
<li><strong>機密自動脫敏</strong>：API Key / Token 即時脫敏，.env 檔案強制 POSIX 0600 權限。</li>
</ul>
</li>
<li>🧪 <strong>全面測試與資安認證</strong>：
<ul>
<li>新增 31 項安全治理單元測試 100% 通過（<code>pytest tests/test_security_governance.py</code>）。</li>
<li>通過 Bandit AST 安全掃描（0 告警）與 Safety 依賴漏洞審查（0 CVE）。</li>
</ul>
</li>
</ol>
<hr />
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/23f1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--stopwatch" style="height:23px;width:auto;vertical-align:middle" title="⏱" alt="⏱" />️ 30 秒看懂這篇文章</h2>
<p dir="auto">如果你用 Hermes Agent 跑過複雜任務，大概都遇過這四個痛點——本文用八層原生架構逐一應對：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:left">痛點</th>
<th style="text-align:left">現場症狀</th>
<th style="text-align:left">Hybrid v2.3 解決方案</th>
<th style="text-align:left">成果</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f40c.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--snail" style="height:23px;width:auto;vertical-align:middle" title="🐌" alt="🐌" /> <strong>問答延遲與 Tool 冗餘</strong></td>
<td style="text-align:left">每輪加載全部 Tool Schema，簡單問題也要等 2.5 秒</td>
<td style="text-align:left"><strong>Fast Path 分流 ＋ 語意快取</strong>：L0 移除 Tool、高頻直接命中</td>
<td style="text-align:left"><strong>分流判定 0.14 ms / 快取直出 &lt; 5 ms</strong></td>
</tr>
<tr>
<td style="text-align:left"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f3ad.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--performing_arts" style="height:23px;width:auto;vertical-align:middle" title="🎭" alt="🎭" /> <strong>驗收依賴模型主觀幻覺</strong></td>
<td style="text-align:left">模型自稱「檔案已寫入」，實體檔案根本不存在</td>
<td style="text-align:left"><strong>Objective Verifier</strong>：Exit Code + 檔案大小 + AST 物理硬驗收</td>
<td style="text-align:left"><strong>客觀檢驗，大幅降低假完工幻覺</strong></td>
</tr>
<tr>
<td style="text-align:left"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f480.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--skull" style="height:23px;width:auto;vertical-align:middle" title="💀" alt="💀" /> <strong>16 輪逾時死局</strong></td>
<td style="text-align:left">反覆試錯 + 巨量 Log 把 Context 塞滿到 47k，最後 <code>Request timed out</code></td>
<td style="text-align:left"><strong>Runtime Control v1</strong>：4KB 輸出裁剪 + 92% 資源優雅交付</td>
<td style="text-align:left"><strong>大幅降低逾時中斷，維持 50+ t/s</strong></td>
</tr>
<tr>
<td style="text-align:left"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4be.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--floppy_disk" style="height:23px;width:auto;vertical-align:middle" title="💾" alt="💾" /> <strong>歷史資料庫膨脹</strong></td>
<td style="text-align:left">舊版 FTS5 影子表重複儲存文字，<code>state.db</code> 破 1GB</td>
<td style="text-align:left"><strong>FTS5 External-Content</strong>：排除機器輸出</td>
<td style="text-align:left"><strong>1.07 GB → 508.70 MB（-52.5%）</strong></td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>其他核心成果</strong>：</p>
<ul>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> <strong>全自動回歸測試</strong>：本地整合 <strong>85/85</strong> 項測試 100% PASS（0.228 秒），開源版 6 大能力與 31 項安全治理測試全數 PASS</li>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--shield" style="height:23px;width:auto;vertical-align:middle" title="🛡" alt="🛡" />️ <strong>對抗性安全防護</strong>：實測常見 13 種 Shell 繞過手法均成功攔截，高風險操作強制繁中審批</li>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4e6.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--package" style="height:23px;width:auto;vertical-align:middle" title="📦" alt="📦" /> <strong>KV Cache 最佳化</strong>：動態限制工具回傳體積，維持本地 27B 穩定推論速度</li>
</ul>
<hr />
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f3db.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--classical_building" style="height:23px;width:auto;vertical-align:middle" title="🏛" alt="🏛" />️ 一、八層混合架構總覽</h2>
<p dir="auto">整條執行資料流由上至下嚴格貫穿八層原生防線，每層各司其職、層層防禦：</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/4c45a32c-0ed2-42c9-ba7a-cb4ed84fdf9a.png" alt="architecture.png" class=" img-fluid img-markdown" /></p>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4cc.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--pushpin" style="height:23px;width:auto;vertical-align:middle" title="📌" alt="📌" /> <strong>八層架構重點導讀</strong>：</p>
<ul>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--zap" style="height:23px;width:auto;vertical-align:middle" title="⚡" alt="⚡" /> <strong>分流加速（1~2 層）</strong>：L0 判定 0.14ms 極速直出；多步驟任務自動啟動條件式狀態機，Verifier 通過才推進下一步。</li>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--shield" style="height:23px;width:auto;vertical-align:middle" title="🛡" alt="🛡" />️ <strong>安全與控制（3~5 層）</strong>：HAOS 實體防繞過閘門 + 跨輪次狀態重置 + 上下文過載防護。</li>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f3af.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--dart" style="height:23px;width:auto;vertical-align:middle" title="🎯" alt="🎯" /> <strong>物理驗收與沉澱（6~8 層）</strong>：避免模型主觀幻覺，以 Exit Code / AST 客觀驗證；成功經驗自動提煉 YAML SOP，人類確認後落盤。</li>
</ul>
</blockquote>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4cb.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--clipboard" style="height:23px;width:auto;vertical-align:middle" title="📋" alt="📋" /> 八層原生模組映射表</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:center">層級</th>
<th style="text-align:left">核心模組</th>
<th style="text-align:left">實戰本機對應檔案</th>
<th style="text-align:left">開源 SDK 提煉封裝 (<code>hermes-hybrid-core</code>)</th>
<th style="text-align:left">核心職責與機制</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><strong>L1</strong></td>
<td style="text-align:left"><strong>Fast Path 極速分流</strong></td>
<td style="text-align:left"><code>agent/fast_path.py</code></td>
<td style="text-align:left"><code>agent/fast_path.py</code></td>
<td style="text-align:left">L0 問答物理剝除全部 Tool Schema，分流判定 0.14ms</td>
</tr>
<tr>
<td style="text-align:center"><strong>L2</strong></td>
<td style="text-align:left"><strong>條件式規劃狀態機</strong></td>
<td style="text-align:left"><code>agent/planner.py</code></td>
<td style="text-align:left"><code>capabilities/planner_recovery/</code> (CAP-002)</td>
<td style="text-align:left">鎖定當前步驟，嚴禁跳步；Verifier PASS 後才推進</td>
</tr>
<tr>
<td style="text-align:center"><strong>L3</strong></td>
<td style="text-align:left"><strong>HAOS 安全閘門</strong></td>
<td style="text-align:left"><code>agent/tool_executor.py</code></td>
<td style="text-align:left"><code>haos/</code> (5.2 憲法) + <code>hermes_core/security_filter.py</code></td>
<td style="text-align:left">實測常見 13 種 Shell 繞過手法均有效攔截；高風險指令強制審批</td>
</tr>
<tr>
<td style="text-align:center"><strong>L4</strong></td>
<td style="text-align:left"><strong>實體工具執行 + 沙盒隔離</strong></td>
<td style="text-align:left"><code>tools/</code></td>
<td style="text-align:left"><code>capabilities/sandboxed_mcp/</code> (CAP-006)</td>
<td style="text-align:left">原生 Toolsets；沙盒適配隔離，有效防禦路徑穿越與逃逸</td>
</tr>
<tr>
<td style="text-align:center"><strong>L5</strong></td>
<td style="text-align:left"><strong>Runtime Control 資源盾牌</strong></td>
<td style="text-align:left"><code>agent/runtime_control.py</code></td>
<td style="text-align:left"><code>agent/runtime_control.py</code> + <code>hermes_core/</code></td>
<td style="text-align:left">跨輪狀態隔離 + 輸出 &gt;4KB 裁剪 94% + 92% 優雅交付</td>
</tr>
<tr>
<td style="text-align:center"><strong>L6</strong></td>
<td style="text-align:left"><strong>客觀實體驗證器</strong></td>
<td style="text-align:left"><code>agent/verifier_engine.py</code></td>
<td style="text-align:left"><code>capabilities/inline_patch/</code> (CAP-001) + <code>evidence_logger.py</code></td>
<td style="text-align:left">Exit Code / AST 解析；鐵律：UNKNOWN ≠ PASS，最多修復 2 次</td>
</tr>
<tr>
<td style="text-align:center"><strong>L7</strong></td>
<td style="text-align:left"><strong>任務完工審查器</strong></td>
<td style="text-align:left"><code>agent/task_reviewer.py</code></td>
<td style="text-align:left"><code>hermes_core/evidence_logger.py</code></td>
<td style="text-align:left">調閱 Evidence Ledger 實體證據鏈，大幅減少模型自稱完工的幻覺</td>
</tr>
<tr>
<td style="text-align:center"><strong>L8</strong></td>
<td style="text-align:left"><strong>經驗提煉與技能沉澱</strong></td>
<td style="text-align:left"><code>agent/skill_learner.py</code></td>
<td style="text-align:left"><code>capabilities/extension_layer/</code> (CAP-004)</td>
<td style="text-align:left">自動提煉 YAML SOP；雙 ID 綁定防偽造，人類審批落盤</td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--bulb" style="height:23px;width:auto;vertical-align:middle" title="💡" alt="💡" /> <strong>開源模組映射與解耦說明（必讀）</strong>：<br />
上表中「實戰本機」是當初我們在本地 Hermes Agent 本體硬改實裝時的檔案分佈；而在<strong>正式開源發布的 <code>hermes-hybrid-core</code> 倉庫中</strong>，我們將這八層架構進一步實施了**「工業級解耦」**：</p>
<ol>
<li>將本體緊耦合的加速與防護邏輯，抽離為獨立的 <strong><code>hermes_core</code> 統一 Python SDK</strong>（可直接 <code>import hermes_core</code> 獲得語意快取、連線池、熔斷器與安全治理）。</li>
<li>將 L2/L4/L6 等規劃、自我修復與沙盒防禦，提煉為 6 個獨立可熱插拔的 <strong><code>capabilities/</code>（CAP-001~006 能力庫）</strong>，各附帶 <code>manifest.json</code> 與 <code>validator.py</code>。</li>
<li>這使得社群朋友無論使用的是原版 Hermes，或是 LangChain / AutoGen / 自研 Python Agent，都能零摩擦直接外掛使用，不需改造整個主程式！</li>
</ol>
</blockquote>
<hr />
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--zap" style="height:23px;width:auto;vertical-align:middle" title="⚡" alt="⚡" /> 二、六大核心升級模組拆解</h2>
<h3>1️⃣ Fast Path 意圖分流 — 讓簡單問題 0.14ms 直出</h3>
<p dir="auto">在 <code>conversation_loop.py</code> 進入點進行極輕量正則與特徵分析，分四級處理：</p>
<ul>
<li><strong>L0（直出問答）</strong>：物理把 <code>tools = []</code> 傳給模型，完全省去 Tool Schema → 推論延遲 <strong>0.142 ms</strong></li>
<li><strong>L1（唯讀排查）</strong>：物理裁剪所有寫入/刪除工具，只留 <code>read_file</code>、<code>search_files</code> 等唯讀工具（預算：240s / 12 次）</li>
<li><strong>L2 / L3（標準與高危）</strong>：全開工具，並掛載安全硬閘門（預算：400s~480s / 16 次）</li>
</ul>
<pre><code class="language-python"># 核心判定邏輯示意（虛擬碼）：
def fast_path_route(user_msg: str) -&gt; tuple[int, list]:
    if is_greeting_or_ack(user_msg) or (len(user_msg) &lt; 20 and not has_tool_intent(user_msg)):
        return L0, []                      # 直出問答：物理剝離全部 Tool Schema
    if only_read_intent(user_msg):         # 僅含「查/看/搜尋」等唯讀意圖
        return L1, [read_file, search_files]
    if has_write_or_exec_intent(user_msg):
        return L2, ALL_TOOLS               # 掛載安全硬閘門
    return L3, ALL_TOOLS                   # 複雜任務：全開 + 規劃狀態機
</code></pre>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--bulb" style="height:23px;width:auto;vertical-align:middle" title="💡" alt="💡" /> <strong>關鍵思維</strong>：<strong>Tool Schema 是每輪 API 調用的固定成本</strong>。L0 把 <code>tools = []</code> 直接傳給模型，不是「隱藏」而是「物理移除」，本地 27B 的首字判定開銷大幅下降。</p>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ <strong>延遲精準定義（避免誤解）</strong>：<strong>0.14ms</strong> 是 Fast-Path 在 Python 層級執行意圖分析與動態剝離 Tool Schema 的<strong>本機代碼判定耗時</strong>（免去了每輪大模型加載全部工具定義的開銷，使首字延遲 TTFT 驟降）；而模型實際生成文字的速度為 <strong>50+ tokens/s</strong>。若後續命中了 <strong>Semantic Cache 語意快取</strong>，則是真正由記憶體以 <strong>&lt; 5ms 直出全文</strong>（零 GPU 算力負擔）。</p>
</blockquote>
<h4><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2699.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--gear" style="height:23px;width:auto;vertical-align:middle" title="⚙" alt="⚙" />️ 實戰調校：延遲容忍門檻與 ReDoS 字典防護</h4>
<p dir="auto">在後續的實戰調校與 v2.3 升級中，我們進一步針對分流機制做了兩項關鍵優化：</p>
<ol>
<li><strong>放寬延遲合格門檻至 &lt; 50ms</strong>：原本門檻設得過於苛刻，實戰中本機磁碟暫態微抖動會讓判定耗時偶發微升，導致被誤判為「分流失敗」；放寬至 &lt; 50ms 後有效吸收了系統抖動，提升判定穩定性。</li>
<li><strong>重構為 $O(N)$ 詞組字典查找</strong>：原本中文意圖識別採用正則表達式，在遇到長篇混雜文字時存在回溯卡頓風險；重構為字典集合比對後完全不走正則回溯，具備 ReDoS 防護能力，避免長文字比對導致 CPU 飆高假死。</li>
</ol>
<hr />
<h3>2️⃣ Objective Verifier — 不聽模型說，只看物理證據</h3>
<p dir="auto">工具執行後，<strong>嚴禁讓 LLM 自行猜測結果</strong>，由 Verifier 執行三道物理硬檢驗：</p>
<ol>
<li><strong>OS Exit Code == 0</strong></li>
<li><strong>檔案存在且大小 &gt; 0 bytes</strong></li>
<li><strong>Python AST 語法檢查</strong></li>
</ol>
<pre><code class="language-python"># 物理驗證判定流程示意（虛擬碼）：
def verify(tool_call, result) -&gt; Verdict:
    if result.exit_code != 0:
        return FAIL("non-zero exit code")
    if tool_call.writes_file:
        if not os.path.isfile(target) or os.path.getsize(target) == 0:
            return FAIL("file missing or empty")   # 杜絕「假寫入」幻覺
    if target.endswith(".py"):
        try:
            ast.parse(source)
        except SyntaxError as e:
            return FAIL(f"AST syntax error: {e}")
    return PASS(evidence=collect_evidence(result))  # 證據記入 Evidence Ledger
</code></pre>
<ul>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--shield" style="height:23px;width:auto;vertical-align:middle" title="🛡" alt="🛡" />️ <strong>鐵律一：UNKNOWN ≠ PASS</strong>：證據不足一律視為未通過（Fail-Closed）；客觀證據寫入 Evidence Ledger，資料庫強制 POSIX 0600 安全權限，啟用 SQLite WAL 模式並設有 10,000 筆上限自動滾動清理，兼顧審計留存與磁碟空間。</li>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f504.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--arrows_counterclockwise" style="height:23px;width:auto;vertical-align:middle" title="🔄" alt="🔄" /> <strong>鐵律二：有界修復機制</strong>：<code>RepairLoopController</code> 限制單一目標最多修復 <strong>2 次</strong>，超限立即 <code>ESCALATE</code>，杜絕無限迴圈。</li>
</ul>
<hr />
<h3>3️⃣ Runtime Control — 五道防護降低逾時與狀態殘留風險 (PROD-READY)</h3>
<p dir="auto"><img src="https://upload.lcz.me/uploads/ed4324c0-eee1-4050-bad5-d766423720af.png" alt="runtime_control.png" class=" img-fluid img-markdown" /></p>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--shield" style="height:23px;width:auto;vertical-align:middle" title="🛡" alt="🛡" />️ <strong>五道防護執行流程亮點</strong>：</p>
<ul>
<li><strong>預防空轉</strong>：每輪執行前檢查時間與次數預算，並自動重置計時器消除記憶體殘留。</li>
<li><strong>物理裁剪</strong>：Tool 輸出 &gt;4KB 自動前後保留 15 行，省 94% KV Cache 空間。</li>
<li><strong>優雅收斂</strong>：預算達 92% 自動交付實體 Evidence Ledger 報告，大幅降低長程任務 600s 逾時中斷率。</li>
</ul>
</blockquote>
<ol>
<li><strong>多維度預算閘門</strong>：依 Tier 設定時間與次數預算（L1: 240s / 12 次；L2: 400s / 16 次；L3: 480s / 16 次），精準覆蓋複雜工程任務</li>
<li><strong>跨輪次狀態隔離（State Isolation）</strong>：每輪對話進入點自動重置預算計時器與循環探測器，消除 Daemon 記憶體殘留誤判</li>
<li><strong>循環與廣域搜尋熔斷</strong>：連續 3 次相同 Tool 調用立即熔斷；<code>grep /home</code> 這類廣域搜尋直接攔截</li>
<li><strong>大輸出物理裁剪</strong>：單一 Tool 輸出 &gt; 4KB 自動保留前後 15 行，<strong>節省 94% KV Cache</strong>，本地 Qwen 27B 維持 50+ t/s</li>
<li><strong>優雅證據交付（Graceful Handover）</strong>：資源達 92% 臨界值時<strong>嚴禁發起新 Tool</strong>，直接把已完成的 Evidence Ledger 輸出為結構化 Markdown 報告</li>
</ol>
<hr />
<h3>3.5️⃣ 即時執行遙測頁腳（Telemetry Footer）— 9 大全生命週期指標與耗時數學閉環核對</h3>
<p dir="auto">每輪對話回覆末尾自動附帶一行極簡圖示遙測頁腳，讓使用者與開發者即時掌握本輪執行的全生命週期健康度：</p>
<pre><code class="language-text">[📜30.2k 💾95.5% 💻4(2.5s) 🛠️2(0.9s) ⚡2.4s 🧠68.8s ✍️17.4s ⏱️92.0s ⏳82.6 t/s]
</code></pre>
<h4><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4ca.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--bar_chart" style="height:23px;width:auto;vertical-align:middle" title="📊" alt="📊" /> 全生命週期九大遙測指標速查表</h4>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:center">圖示</th>
<th style="text-align:left">指標名稱</th>
<th style="text-align:left">說明</th>
<th style="text-align:left">正常健康基準</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4dc.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--scroll" style="height:23px;width:auto;vertical-align:middle" title="📜" alt="📜" /></td>
<td style="text-align:left"><strong>上下文長度</strong></td>
<td style="text-align:left">當前對話 Context Token 總量</td>
<td style="text-align:left">5k ~ 65k（視任務長度）</td>
</tr>
<tr>
<td style="text-align:center"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4be.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--floppy_disk" style="height:23px;width:auto;vertical-align:middle" title="💾" alt="💾" /></td>
<td style="text-align:left"><strong>快取命中率</strong></td>
<td style="text-align:left">Prompt Caching 前綴快取命中百分比</td>
<td style="text-align:left"><strong>&gt; 90%</strong>（首字極速）</td>
</tr>
<tr>
<td style="text-align:center"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4bb.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--computer" style="height:23px;width:auto;vertical-align:middle" title="💻" alt="💻" /></td>
<td style="text-align:left"><strong>本地系統工作</strong></td>
<td style="text-align:left">本機系統工作次數與耗時（Prompt 拼裝、Token 防爆、SQLite 存檔、安全審查）</td>
<td style="text-align:left">動態呈現，通常 &lt; 3s</td>
</tr>
<tr>
<td style="text-align:center"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e0.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--hammer_and_wrench" style="height:23px;width:auto;vertical-align:middle" title="🛠" alt="🛠" />️</td>
<td style="text-align:left"><strong>工具執行耗時</strong></td>
<td style="text-align:left">本輪實際調用之 Tool 總次數與實體執行總秒數</td>
<td style="text-align:left">依工具 I/O 特性而定</td>
</tr>
<tr>
<td style="text-align:center"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--zap" style="height:23px;width:auto;vertical-align:middle" title="⚡" alt="⚡" /></td>
<td style="text-align:left"><strong>網路與連線延遲</strong></td>
<td style="text-align:left">請求建立與首字延遲 (TTFT)</td>
<td style="text-align:left"><strong>&lt; 1.0s</strong>（快取命中時更低）</td>
</tr>
<tr>
<td style="text-align:center">🧠</td>
<td style="text-align:left"><strong>推理思考耗時</strong></td>
<td style="text-align:left">模型 Prefill、注意力計算與思考階段耗時</td>
<td style="text-align:left">視 Context 長度而定</td>
</tr>
<tr>
<td style="text-align:center"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/270d.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--writing_hand" style="height:23px;width:auto;vertical-align:middle" title="✍" alt="✍" />️</td>
<td style="text-align:left"><strong>吐字生成耗時</strong></td>
<td style="text-align:left">本地模型實際解碼生成 Token 之純文字耗時</td>
<td style="text-align:left">穩定維持輸出階段</td>
</tr>
<tr>
<td style="text-align:center"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/23f1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--stopwatch" style="height:23px;width:auto;vertical-align:middle" title="⏱" alt="⏱" />️</td>
<td style="text-align:left"><strong>整輪真實總時</strong></td>
<td style="text-align:left">端到端總秒數（<strong>各子階段耗時數學閉環相加</strong>）</td>
<td style="text-align:left">均在預算安全限額內</td>
</tr>
<tr>
<td style="text-align:center"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/23f3.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--hourglass_flowing_sand" style="height:23px;width:auto;vertical-align:middle" title="⏳" alt="⏳" /></td>
<td style="text-align:left"><strong>綜合平均速度</strong></td>
<td style="text-align:left">吐字生成階段之真實速度（Tokens/Second）</td>
<td style="text-align:left"><strong>50+ t/s</strong>（27B 量化）</td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/23f1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--stopwatch" style="height:23px;width:auto;vertical-align:middle" title="⏱" alt="⏱" />️ <strong>耗時數學閉環驗證</strong>：<br />
各環節耗時透明無死角，一眼即可心算核對出總時間：<br />
<strong>2.5s (<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4bb.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--computer" style="height:23px;width:auto;vertical-align:middle" title="💻" alt="💻" /> 本地系統) + 0.9s (<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e0.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--hammer_and_wrench" style="height:23px;width:auto;vertical-align:middle" title="🛠" alt="🛠" />️ 工具執行) + 2.4s (<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--zap" style="height:23px;width:auto;vertical-align:middle" title="⚡" alt="⚡" /> 連線) + 68.8s (🧠 思考) + 17.4s (<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/270d.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--writing_hand" style="height:23px;width:auto;vertical-align:middle" title="✍" alt="✍" />️ 吐字) = 92.0s (<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/23f1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--stopwatch" style="height:23px;width:auto;vertical-align:middle" title="⏱" alt="⏱" />️ 總耗時)</strong></p>
</blockquote>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--bulb" style="height:23px;width:auto;vertical-align:middle" title="💡" alt="💡" /> <strong>9/5 實戰進化：語意快取命中時的極致遙測</strong>：<br />
當遇到高頻或重複查詢命中 <code>Semantic Cache</code> 時，遙測頁腳會呈現零 GPU 負載的極限直出數據：</p>
<pre><code class="language-text">[📜0.8k 💾100% 💻1(0.002s) 🛠️0 ⚡0.003s 🧠0.0s ✍️0.0s ⏱️0.005s ⏳DIRECT_HIT]
</code></pre>
<p dir="auto">讀者可直接對照出「快取命中（&lt;5ms 免算力）」與「常規 27B 推論」的巨大效能落差！</p>
</blockquote>
<hr />
<h3>4️⃣ Phase H8 原生 SVG 浮點無損座標優化（<code>agent/svg_optimizer.py</code>）</h3>
<ul>
<li>LLM 生成的架構圖 SVG 常包含冗長浮點座標（如 <code>234.567891px</code>）</li>
<li>原生模組自動將座標四捨五入至 <strong>0.01px 精度</strong>，<strong>體積縮減 35%~50%，維持向量清晰度</strong></li>
<li>結合 XML AST 語法驗證與隔離子進程渲染，有效排除 Linux 環境下 C-FFI / fontconfig 鎖死問題</li>
</ul>
<hr />
<h3>5️⃣ SQLite 底層重構 — FTS5 External-Content 深度瘦身（<code>state.db</code>）</h3>
<ul>
<li>舊版 v22 影子表重複儲存 <code>messages.content</code>（浪費 369.66 MB），且對 94.7 MB 的 Tool 機器輸出無差別建索</li>
<li>透過 <strong>3 道 Human Gate 安全機制</strong>（冷備份雙 SHA-256 驗證 → 官方遷移 → Live 冒煙測試），升級為 <strong>v23 External-Content</strong></li>
<li>透過 View 排除 Tool 機器日誌 Trigram 索引：
<ul>
<li><strong>資料庫體積從 <code>1.07 GB</code> 驟降至 <code>508.70 MB</code>（實體瘦身 52.5%，淨省 561.42 MB）</strong></li>
<li>101,958 筆訊息與 1,919 個 Session <strong>完整保留</strong>，檢索延遲降至 <strong>&lt; 0.8 ms</strong></li>
</ul>
</li>
</ul>
<pre><code class="language-sql">-- 文字只存在主表，FTS5 影子表僅存索引，不再重複拷貝 content
CREATE VIRTUAL TABLE messages_fts USING fts5(
    content,
    content='messages',      -- 外部內容表：文字單一真理來源
    content_rowid='id'
);

-- 排除 Tool 機器輸出的無差別建索（僅索引人讀對話）
CREATE VIEW fts_indexable AS
SELECT id, content FROM messages WHERE role != 'tool';
</code></pre>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--bulb" style="height:23px;width:auto;vertical-align:middle" title="💡" alt="💡" /> <strong>關鍵思維</strong>：<strong>FTS5 預設會把全文再存一份到影子表</strong>。對「對話 + 巨量 Tool 輸出」的 Agent 資料庫，External-Content + View 過濾是磁碟空間的免費午餐。</p>
</blockquote>
<h4><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f5c4.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--file_cabinet" style="height:23px;width:auto;vertical-align:middle" title="🗄" alt="🗄" />️ 應用延伸：三層 SQLite 極速檢索中樞（三軌分流）</h4>
<p dir="auto">瘦身解決的是「資料庫體積」，三軌分流解決的則是「<strong>查什麼走哪條路</strong>」：</p>
<ul>
<li><strong>升級前</strong>：一個萬用查詢把「單據、工時、保養」三種需求混在一起，且每次查詢都現掃檔案，資料一多就慢。</li>
<li><strong>升級後</strong>：把檢索拆成三條獨立軌道，各走各的 SQLite 引擎；工作日誌建立/追加後由 <code>work_logs_engine.py</code> <strong>自動同步進 SQLite</strong>，晨間簡報與未結事項同步腳本<strong>直連 SQLite 做毫秒級讀寫</strong>，不再每次現掃檔案。</li>
</ul>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:center">軌道</th>
<th style="text-align:left">查什麼</th>
<th style="text-align:left">調用入口</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><strong>① 全域單據檢索</strong></td>
<td style="text-align:left">歷史單據、維修單、發票、知識庫</td>
<td style="text-align:left"><code>search_archives.py "&lt;關鍵字&gt;"</code></td>
</tr>
<tr>
<td style="text-align:center"><strong>② 日誌與工時統計</strong></td>
<td style="text-align:left">客戶工時統計、歷史日誌</td>
<td style="text-align:left"><code>query_work_logs.py --customer "&lt;客戶&gt;" / --stats</code></td>
</tr>
<tr>
<td style="text-align:center"><strong>③ 保養與未結追蹤</strong></td>
<td style="text-align:left">客戶未結事項、即期保養</td>
<td style="text-align:left"><code>query_maintenance_tracker.py --customer "&lt;客戶&gt;" / --summary</code></td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--bulb" style="height:23px;width:auto;vertical-align:middle" title="💡" alt="💡" /> <strong>關鍵思維</strong>：<strong>檢索慢多半不是資料庫慢，是「查錯路徑」</strong>。三軌分流讓每類查詢走最窄的索引，配合 FTS5 External-Content 瘦身，單據檢索實測可壓到百毫秒級命中。</p>
</blockquote>
<hr />
<h3>6️⃣ Skill Learning — 經驗自動沉澱，人類審批落盤（<code>agent/skill_learner.py</code>）</h3>
<ul>
<li>多步驟任務成功後，自動提煉含標準 YAML Frontmatter 的 <code>SKILL.md</code> 候選</li>
<li><strong>雙 ID 綁定防偽造</strong>：Pending 候選以 <code>task_id:candidate_id</code> 綁定於 Session</li>
<li><strong>人類審批</strong>：在對話中說「確認保存技能」或 <code>/approve_skill</code>，確認後才落盤至 <code>~/.hermes/skills/</code></li>
</ul>
<hr />
<h2>🧩 二之延伸、六大正式外掛能力庫（CAP-001 ~ CAP-006）</h2>
<p dir="auto">前六大模組是「內建在本體」的八層防線；這輪升級把六項<strong>可獨立驗證、可熱插拔</strong>的能力抽離成正式外掛庫，統一收在 <code>~/.hermes/capabilities/</code>。每個能力都是獨立子資料夾，含 <code>manifest.json</code>（中繼資料與依賴）、<code>tools.py</code>（實體工具）、<code>validator.py</code>（自我健全檢驗）三件套，<strong>通過完整 Gate 檢驗並經人類審批簽核後才晉升正式能力</strong>——不是寫完就生效，而是「先驗收、再上線」。</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/68505ff8-796b-4096-9ea8-5d459d5b4065.png" alt="upgrade_comparison.png" class=" img-fluid img-markdown" /></p>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4cc.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--pushpin" style="height:23px;width:auto;vertical-align:middle" title="📌" alt="📌" /> <strong>怎麼讀這張表</strong>：左欄是「升級前」的痛點，右欄是「升級後」的能力，一眼看懂每個 CAP 到底改了什麼。</p>
</blockquote>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:center">能力</th>
<th style="text-align:left">升級前（痛點）</th>
<th style="text-align:left">升級後（能力）</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><strong>CAP-001</strong> <code>inline_patch</code></td>
<td style="text-align:left">改 3 行也要把整個檔案重寫一遍，Token 爆量</td>
<td style="text-align:left">原子化精準搜尋取代，只送「目標片段 + 取代片段」，附 AST 驗證與 unified diff</td>
</tr>
<tr>
<td style="text-align:center"><strong>CAP-002</strong> <code>planner_recovery</code></td>
<td style="text-align:left">多步驟任務中途卡死，只能整段從頭重跑</td>
<td style="text-align:left">Sub-Task DAG 狀態機，已完成步驟凍結，只對失敗分支局部重編</td>
</tr>
<tr>
<td style="text-align:center"><strong>CAP-003</strong> <code>agent_loop_recover</code></td>
<td style="text-align:left">報錯後把整段 traceback 丟回模型盲目重試，空轉到逾時</td>
<td style="text-align:left">結構化診斷特徵提取 + 自癒引導 + 2 次有界熔斷</td>
</tr>
<tr>
<td style="text-align:center"><strong>CAP-004</strong> <code>extension_layer</code></td>
<td style="text-align:left">加新工具要重啟、壞工具拖垮整個系統</td>
<td style="text-align:left">熱插拔工具註冊 + 上線前健康隔離，壞能力自動隔離不影響主體</td>
</tr>
<tr>
<td style="text-align:center"><strong>CAP-005</strong> <code>operator_deadletter</code></td>
<td style="text-align:left">排程任務連錯無人知，靜默失敗</td>
<td style="text-align:left">Cron 死信佇列 + 熔斷 + 去重告警 + 慢探針自癒</td>
</tr>
<tr>
<td style="text-align:center"><strong>CAP-006</strong> <code>sandboxed_mcp</code></td>
<td style="text-align:left">外部 MCP 工具直接碰本機真實路徑，資安裸奔</td>
<td style="text-align:left">沙盒適配器 + 安全橋，路徑逃逸（<code>../</code>）與指令注入在橋接層就被攔截</td>
</tr>
</tbody>
</table>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f527.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--wrench" style="height:23px;width:auto;vertical-align:middle" title="🔧" alt="🔧" /> CAP-001 inline_patch — 小修改不再全檔重寫</h3>
<ul>
<li><strong>升級前</strong>：模型改檔案是「整檔重寫」——把整個原檔讀進 Context、再輸出整個改後檔，檔案越大、修改越小，浪費越誇張。</li>
<li><strong>升級後</strong>：&lt;30 行的修改改走「原子化精準搜尋取代」，只把「目標片段 + 取代片段」送給模型，附帶 AST 語法驗證與 unified diff 輸出。</li>
</ul>
<p dir="auto"><strong>實測數據</strong>（1592 行 / 36,836 字元的 Python 模組，改 3 處、每處 1 行）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:left">做法</th>
<th style="text-align:center">送給模型的 Token</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">全檔重寫（輸入 + 輸出）</td>
<td style="text-align:center">18,418</td>
</tr>
<tr>
<td style="text-align:left">inline_patch（輸入 + 輸出）</td>
<td style="text-align:center">44</td>
</tr>
<tr>
<td style="text-align:left"><strong>節省</strong></td>
<td style="text-align:center"><strong>99.8%（全檔重寫 ≈ 418 倍）</strong></td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 這是「大檔 + 極少修改」的極端場景，所以比例特別高；實際修改處越多、檔案越小，節省比例會往下掉，但方向不變——<strong>修改越小、檔案越大，inline_patch 越省</strong>。能少送給模型的 Token，就一個都別送。</p>
</blockquote>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f504.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--arrows_counterclockwise" style="height:23px;width:auto;vertical-align:middle" title="🔄" alt="🔄" /> CAP-002 / CAP-003 — 多步驟任務的「局部重編」與「報錯自癒」</h3>
<ul>
<li><strong>CAP-002</strong>：把任務建模成 Sub-Task DAG，<strong>已完成步驟凍結為不可變</strong>，卡住時只對失敗分支做局部重編，避免整段從頭重跑。</li>
<li><strong>CAP-003</strong>：先做<strong>結構化診斷特徵提取</strong>（而非整段 traceback），依特徵引導自癒，並設 <strong>2 次有界熔斷</strong>，避免無限迴圈盲目重試。</li>
</ul>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--shield" style="height:23px;width:auto;vertical-align:middle" title="🛡" alt="🛡" />️ CAP-006 sandboxed_mcp — 外部工具進門先過沙盒</h3>
<ul>
<li><strong>升級前</strong>：外部 MCP 工具直接碰本機真實路徑，一旦有路徑逃逸（<code>../</code>）或指令注入，等於資安裸奔。</li>
<li><strong>升級後</strong>：外部工具一律經沙盒適配器與安全橋進入，<strong>路徑逃逸與指令注入在橋接層就被攔截</strong>，外部工具碰不到本機真實路徑。在 9/5 的 PROD-READY 升級中，更進一步加入了 <strong>Unicode NFKC 正規化、32 跳符號連結迴圈防護</strong>，以及物理黑名單阻斷 <code>.env</code>、<code>.vscode</code>、<code>.terraform</code>、<code>Dockerfile</code> 等 28+ 種敏感隱藏目錄與金鑰檔案。這把前文「安全規則寫在程式碼、不是 Prompt」的原則，落實到了外部工具邊界。</li>
</ul>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--bulb" style="height:23px;width:auto;vertical-align:middle" title="💡" alt="💡" /> <strong>關鍵思維</strong>：<strong>能力要「可獨立驗收」才配叫正式能力</strong>。每個 CAP 自帶 <code>validator.py</code> 做自我健全檢驗，加上人類審批簽核，才能從「候選」晉升「正式」。這讓外掛庫不會變成一堆來路不明、壞了沒人管的腳本堆。</p>
</blockquote>
<hr />
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4ca.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--bar_chart" style="height:23px;width:auto;vertical-align:middle" title="📊" alt="📊" /> 三、量化指標對比（官方原版 vs 自製 Hybrid v2.3 PROD-READY）</h2>
<p dir="auto"><img src="https://upload.lcz.me/uploads/fc24eeed-b6d3-4691-aa4e-303128bbd63f.png" alt="comparison.png" class=" img-fluid img-markdown" /></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:left">指標面向</th>
<th style="text-align:left"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f3e2.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--office" style="height:23px;width:auto;vertical-align:middle" title="🏢" alt="🏢" /> 官方原版</th>
<th style="text-align:left"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f680.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--rocket" style="height:23px;width:auto;vertical-align:middle" title="🚀" alt="🚀" /> Hybrid v2.3 (PROD-READY)</th>
<th style="text-align:center">提升效益</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>高頻問題直出</strong></td>
<td style="text-align:left">~2.5 秒 (全量推論)</td>
<td style="text-align:left"><strong>&lt; 5 ms (語意快取直出)</strong></td>
<td style="text-align:center"><strong>記憶體快取直出 (免走模型推論，省 GPU 算力)</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>簡單問答分流</strong></td>
<td style="text-align:left">~2.5 秒 (每輪載入 Schema)</td>
<td style="text-align:left"><strong>0.14 ms (Fast-Path 判定剝除)</strong></td>
<td style="text-align:center"><strong>Python 代碼極速判定，省去 Tool Schema 載入開銷</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>任務模板秒回</strong></td>
<td style="text-align:left">無 (等待首字生成)</td>
<td style="text-align:left"><strong>&lt; 50 ms (骨架流式預覽)</strong></td>
<td style="text-align:center"><strong>即時結構化進度反饋，支援動態縮退</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>執行驗證準確率</strong></td>
<td style="text-align:left">模型主觀自稱 PASS</td>
<td style="text-align:left"><strong>物理 Exit Code / AST 解析</strong></td>
<td style="text-align:center"><strong>客觀物理狀態校驗，大幅減少假完工幻覺</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>錯誤重試機制</strong></td>
<td style="text-align:left">無限制重試至 16 輪耗盡</td>
<td style="text-align:left"><strong>有界修復（最多 2 次）</strong></td>
<td style="text-align:center"><strong>設有界限自動降級，避免無限盲目重試</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>對抗性安全防禦</strong></td>
<td style="text-align:left">易被 Base64 / 重定向誘騙</td>
<td style="text-align:left"><strong>13 種 Shell + 32-hop 符號連結 + SQL 五層防護</strong></td>
<td style="text-align:center"><strong>程式碼層級攔截常見注入與符號連結穿越</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>ReDoS 回溯卡頓</strong></td>
<td style="text-align:left">正則表達式偶發 CPU 100%</td>
<td style="text-align:left"><strong>$O(N)$ 詞組字典比對 (0 回溯)</strong></td>
<td style="text-align:center"><strong>避免正則回溯導致的 CPU 飆高假死</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>憑證與機密防護</strong></td>
<td style="text-align:left">純文字易存入記錄</td>
<td style="text-align:left"><strong>自動脫敏 + .env 0600 權限</strong></td>
<td style="text-align:center"><strong>自動日誌脫敏保護，降低金鑰洩漏風險</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>KV Cache 資源消耗</strong></td>
<td style="text-align:left">巨量 Log 塞滿 Context（&gt;40k）</td>
<td style="text-align:left"><strong>4KB 物理裁剪（省 94%）</strong></td>
<td style="text-align:center"><strong>本地 27B 維持 50+ t/s 穩定推論</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>資料庫儲存體積</strong></td>
<td style="text-align:left">1.07 GB</td>
<td style="text-align:left"><strong>508.70 MB (WAL 高並發模式)</strong></td>
<td style="text-align:center"><strong>縮減 52.5%，改善併發讀寫效能</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>SVG 架構圖體積</strong></td>
<td style="text-align:left">浮點數冗長</td>
<td style="text-align:left"><strong>0.01px 精度（瘦身 50%）</strong></td>
<td style="text-align:center"><strong>維持向量圖形清晰度</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>逾時中斷率</strong></td>
<td style="text-align:left">易 16 輪超時崩潰</td>
<td style="text-align:left"><strong>92% 提前收斂 + 優雅交付</strong></td>
<td style="text-align:center"><strong>主動收斂交付，大幅降低逾時中斷率</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>資安與回歸測試</strong></td>
<td style="text-align:left">零散測試</td>
<td style="text-align:left"><strong>本地 85/85 PASS / 開源 31 項安全測試全過</strong></td>
<td style="text-align:center"><strong>Bandit 0 告警 / Safety 0 CVE</strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>執行遙測可視化</strong></td>
<td style="text-align:left">無即時遙測</td>
<td style="text-align:left"><strong>每輪 9 項全生命週期頁腳 (數學閉環對齊)</strong></td>
<td style="text-align:center"><strong>客觀數據即時對照</strong></td>
</tr>
</tbody>
</table>
<hr />
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--bulb" style="height:23px;width:auto;vertical-align:middle" title="💡" alt="💡" /> 四、給社群開發者的四條實戰經驗</h2>
<ol>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--shield" style="height:23px;width:auto;vertical-align:middle" title="🛡" alt="🛡" />️ <strong>安全規則寫在程式碼，不是 Prompt</strong><br />
對抗性指令一定要在 <code>tool_executor.py</code> 用 <code>Path.resolve()</code> + 正則硬攔截，Prompt 層面的約束隨時可以被繞過。</li>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--zap" style="height:23px;width:auto;vertical-align:middle" title="⚡" alt="⚡" /> <strong>本地模型一定要做 Tool Output 裁剪</strong><br />
Qwen 27B 或 70B 以下模型在超長 Context 下推論速度會驟降，4KB 的 Head/Tail 裁剪能拯救整個系統的響應速度。</li>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f504.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--arrows_counterclockwise" style="height:23px;width:auto;vertical-align:middle" title="🔄" alt="🔄" /> <strong>Daemon 長期運行要做狀態隔離</strong><br />
Gateway 架構下，每輪對話進入點務必重置計時器與檢測器，避免跨輪次記憶體殘留。</li>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4be.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--floppy_disk" style="height:23px;width:auto;vertical-align:middle" title="💾" alt="💾" /> <strong>善用 FTS5 External-Content 進行資料庫瘦身</strong><br />
避免重複儲存訊息文字並排除 Tool 輸出索引，能直接省下超過一半的磁碟空間。</li>
</ol>
<hr />
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4ac.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--speech_balloon" style="height:23px;width:auto;vertical-align:middle" title="💬" alt="💬" /> 五、歡迎交流與深度討論</h2>
<p dir="auto">這套架構讓 Hermes Agent 在雙 RTX 5070 Ti + 本地 Qwen3.8 27B 上展現了不錯的穩定性與實戰能力。本文分享的是<strong>架構思路與工程決策</strong>，很多參數（預算閾值、裁剪比例、熔斷條件）都是實際踩坑摸索出來的經驗值，給大家參考，<strong>持續使用 HERMES 優化~~</strong></p>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4e6.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--package" style="height:23px;width:auto;vertical-align:middle" title="📦" alt="📦" /> <strong>開源倉庫傳送門</strong>：<a href="https://github.com/ydmjfk/hermes-hybrid-core" rel="nofollow ugc">https://github.com/ydmjfk/hermes-hybrid-core</a><br />
<em>(包含完整開箱即用的 <code>hermes_core</code> 加速 SDK、CAP-001~006 能力庫、一鍵安裝腳本與全自動化測試套件)</em></p>
<p dir="auto"><em><strong>Hermes 女秘書，個人使用純玩~~</strong></em></p>
<p dir="auto">歡迎在下方留言討論！<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f680.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--rocket" style="height:23px;width:auto;vertical-align:middle" title="🚀" alt="🚀" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f91d.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--handshake" style="height:23px;width:auto;vertical-align:middle" title="🤝" alt="🤝" /></p>
]]></description><link>https://lcz.me/topic/1405</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 16:07:53 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1405.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 29 Aug 2026 14:51:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sun, 06 Sep 2026 14:51:19 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yu-chen-chang" aria-label="Profile: Yu-Chen-Chang">@<bdi>Yu-Chen-Chang</bdi></a> <a href="/post/16241">说</a>:</p>
<p dir="auto">很好的分享，不過文章有點長，我直接讓ChatGPT比對我目前使用的架構。畢竟我使用的是能力比在地模型強的多的模型。但是觀念借鑒總是可以激發更好的靈感<br />
我使用的是多agents來管理，核心只有一個agent bus，決定agent如何溝通。</p>
</blockquote>
<blockquote>
<p dir="auto"><strong>文章，我也覺得太長了，因為九成九 HERMES 幫我寫的<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f602.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--joy" style="height:23px;width:auto;vertical-align:middle" title=":joy:" alt="😂" /></strong></p>
<p dir="auto"><strong>你的方式也不錯，多 Agent 分工彈性強</strong>，我是想到什麼，就加什麼的，沒有特別的規劃，分享給大家 互相學習/吐草。<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f601.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--grin" style="height:23px;width:auto;vertical-align:middle" title=":grin:" alt="😁" /> <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f601.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--grin" style="height:23px;width:auto;vertical-align:middle" title=":grin:" alt="😁" /></p>
</blockquote>
]]></description><link>https://lcz.me/post/16245</link><guid isPermaLink="true">https://lcz.me/post/16245</guid><dc:creator><![CDATA[YDM]]></dc:creator><pubDate>Sun, 06 Sep 2026 14:51:19 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sun, 06 Sep 2026 14:22:22 GMT]]></title><description><![CDATA[<p dir="auto">很好的分享，不過文章有點長，我直接讓ChatGPT比對我目前使用的架構。畢竟我使用的是能力比在地模型強的多的模型。但是觀念借鑒總是可以激發更好的靈感<br />
我使用的是多agents來管理，核心只有一個agent bus，決定agent如何溝通。<br />
<img src="https://upload.lcz.me/uploads/793e8ffe-52e6-4ec9-9b33-304cb105cb87.jpeg" alt="7194df3c-4ce0-49fd-b5f5-81158ee600d7-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">比較表如下：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>層次</th>
<th>你的架構</th>
<th>Hybrid Core</th>
</tr>
</thead>
<tbody>
<tr>
<td>Agent 組織</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--star" style="height:23px;width:auto;vertical-align:middle" title="⭐" alt="⭐" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--star" style="height:23px;width:auto;vertical-align:middle" title="⭐" alt="⭐" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--star" style="height:23px;width:auto;vertical-align:middle" title="⭐" alt="⭐" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--star" style="height:23px;width:auto;vertical-align:middle" title="⭐" alt="⭐" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--star" style="height:23px;width:auto;vertical-align:middle" title="⭐" alt="⭐" /></td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--star" style="height:23px;width:auto;vertical-align:middle" title="⭐" alt="⭐" /></td>
</tr>
<tr>
<td>專業分工</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--star" style="height:23px;width:auto;vertical-align:middle" title="⭐" alt="⭐" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--star" style="height:23px;width:auto;vertical-align:middle" title="⭐" alt="⭐" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--star" style="height:23px;width:auto;vertical-align:middle" title="⭐" alt="⭐" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--star" style="height:23px;width:auto;vertical-align:middle" title="⭐" alt="⭐" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--star" style="height:23px;width:auto;vertical-align:middle" title="⭐" alt="⭐" /></td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--star" style="height:23px;width:auto;vertical-align:middle" title="⭐" alt="⭐" /></td>
</tr>
<tr>
<td>Orchestration</td>
<td>Sean Jr</td>
<td>Planner / State Machine</td>
</tr>
<tr>
<td>任務執行</td>
<td>各 Specialist</td>
<td>Executor</td>
</tr>
<tr>
<td>結果驗證</td>
<td>Rhadamanthus</td>
<td><strong>Objective Verifier</strong></td>
</tr>
<tr>
<td>安全控制</td>
<td>Agent 權限</td>
<td><strong>Code-level Hard Gate</strong></td>
</tr>
<tr>
<td>Timeout / Retry</td>
<td>目前較弱</td>
<td><strong>Runtime Control</strong></td>
</tr>
<tr>
<td>Evidence</td>
<td>有來源要求</td>
<td><strong>Evidence Ledger</strong></td>
</tr>
<tr>
<td>Skill 演化</td>
<td>Sean Jr / SkillClaw</td>
<td><strong>Skill Learner</strong></td>
</tr>
<tr>
<td>Token / Context 控制</td>
<td>有模型選擇策略</td>
<td><strong>Kernel 級控制</strong></td>
</tr>
<tr>
<td>Telemetry</td>
<td>尚未成為核心</td>
<td><strong>完整 Runtime Telemetry</strong></td>
</tr>
</tbody>
</table>
]]></description><link>https://lcz.me/post/16241</link><guid isPermaLink="true">https://lcz.me/post/16241</guid><dc:creator><![CDATA[Yu-Chen Chang]]></dc:creator><pubDate>Sun, 06 Sep 2026 14:22:22 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sun, 06 Sep 2026 14:06:05 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kos-or" aria-label="Profile: kos-or">@<bdi>kos-or</bdi></a> <a href="/post/16233">说</a>:</p>
<p dir="auto">Gemini 是雲端模型, 你讓它清除/讀取你的隱私資料 有可能會被用作 Pretraining data,<br />
我們和雲端模型的對話 基本上都會被用來當作下一輪的LLM訓練</p>
</blockquote>
<p dir="auto">我知道呀，我才用本地端先脫敏一次，再GEMINI再跑一次，丟GITHUB的AI(忘記叫啥了)再跑一次，跑完後 開源項目因該就壞掉了，哈~<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f602.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--joy" style="height:23px;width:auto;vertical-align:middle" title=":joy:" alt="😂" /></p>
<p dir="auto">因該使用地端的模型 因該可以修回來，脫敏還發現我的SQL忘了一些注入安全，修好了才丟開源~~</p>
<p dir="auto">最後搞了那麼多，我只跑地端，資安限制那麼多，沒有用呀@@!~<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f630.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--cold_sweat" style="height:23px;width:auto;vertical-align:middle" title=":cold_sweat:" alt="😰" /></p>
]]></description><link>https://lcz.me/post/16237</link><guid isPermaLink="true">https://lcz.me/post/16237</guid><dc:creator><![CDATA[YDM]]></dc:creator><pubDate>Sun, 06 Sep 2026 14:06:05 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sun, 06 Sep 2026 13:20:28 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ydm" aria-label="Profile: YDM">@<bdi>YDM</bdi></a> <a href="/post/15980">said</a>:</p>
<p dir="auto">叫GEMINI 幫我找出隱私清除</p>
</blockquote>
<p dir="auto">Gemini 是雲端模型, 你讓它清除/讀取你的隱私資料 有可能會被用作 Pretraining data,<br />
我們和雲端模型的對話 基本上都會被用來當作下一輪的LLM訓練</p>
]]></description><link>https://lcz.me/post/16233</link><guid isPermaLink="true">https://lcz.me/post/16233</guid><dc:creator><![CDATA[kos or]]></dc:creator><pubDate>Sun, 06 Sep 2026 13:20:28 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sat, 05 Sep 2026 07:51:45 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kos-or" aria-label="Profile: kos-or">@<bdi>kos-or</bdi></a> <a href="/post/15036">说</a>:</p>
</blockquote>
<p dir="auto"><a href="https://github.com/ydmjfk/hermes-hybrid-core" rel="nofollow ugc">https://github.com/ydmjfk/hermes-hybrid-core</a></p>
<p dir="auto">叫GEMINI 幫我找出隱私清除，檢查資安風險，把不必要的個人資訊清除，發到github，因該沒有隱私風險了!!~~~</p>
]]></description><link>https://lcz.me/post/15980</link><guid isPermaLink="true">https://lcz.me/post/15980</guid><dc:creator><![CDATA[YDM]]></dc:creator><pubDate>Sat, 05 Sep 2026 07:51:45 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Mon, 31 Aug 2026 12:26:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kos-or" aria-label="Profile: kos-or">@<bdi>kos-or</bdi></a></p>
<p dir="auto">＞出差中，改天回家再研究看看，感謝！</p>
]]></description><link>https://lcz.me/post/15162</link><guid isPermaLink="true">https://lcz.me/post/15162</guid><dc:creator><![CDATA[YDM]]></dc:creator><pubDate>Mon, 31 Aug 2026 12:26:29 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Mon, 31 Aug 2026 01:33:11 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ydm" aria-label="Profile: YDM">@<bdi>YDM</bdi></a> <a href="/post/14996">said</a>:</p>
<p dir="auto">而且不小心就會被看光光，資安風險高，我的使用方式，因該很多人在玩，只是大同小異，有空再請AI幫我開源試試看!!<br />
(剛剛試了一下 GitHub 丟上去有3000+檔案，算了有空再看看了，不然脫光光給人看了)</p>
</blockquote>
<p dir="auto">還沒使用過, 最近  Anthropic 有開源了一個項目 可以參考看看</p>
<pre><code>Github: claude-code-security-review
</code></pre>
<p dir="auto"><a href="https://github.com/anthropics/claude-code-security-review" rel="nofollow ugc">https://github.com/anthropics/claude-code-security-review</a></p>
<p dir="auto">這是一個基於人工智慧的GitHub安全審查操作，它使用Claude分析程式碼變更中的安全漏洞。此操作利用  Anthropic的Claude Code工具進行深度語意安全分析，為拉取請求提供智慧的、上下文感知的安全分析。</p>
<p dir="auto">特徵<br />
AI驅動分析：利用Claude的高階推理能力，透過深入的語意理解來偵測安全漏洞。<br />
差異感知掃描：對於 PR，僅分析已更改的文件<br />
PR 評論：自動對包含安全發現的 PR 新增評論<br />
上下文理解：超越模式匹配，理解程式碼語義<br />
語言無關：適用於任何程式語言<br />
誤報過濾：進階過濾功能，可減少雜訊並專注於真正的漏洞。</p>
<pre><code>使用Claude Code實現安全 審查 自動化
</code></pre>
<p dir="auto">Claude Blog: <a href="https://claude.com/blog/automate-security-reviews-with-claude-code" rel="nofollow ugc">https://claude.com/blog/automate-security-reviews-with-claude-code</a><br />
<img src="https://upload.lcz.me/uploads/b8aad5ba-0870-4f78-9116-6ba2b9246cd7.jpeg" alt="ecfe8ae0-b223-4d3a-aed3-adba2a0fef3b-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">透過終端審查程式碼漏洞<br />
新增的 <code>/security-review</code> 命令可讓您在提交程式碼之前，從終端機執行臨時安全性分析。在 Claude Code 中執行此命令，Claude 將搜尋您的程式碼庫中潛在的漏洞，並提供發現問題的詳細說明。</p>
<p dir="auto">此命令使用專門的安全提示符，檢查常見的漏洞模式，包括：</p>
<p dir="auto">SQL注入風險<br />
跨站腳本 (XSS) 漏洞<br />
身份驗證和授權缺陷<br />
不安全的數據處理<br />
依賴性漏洞</p>
<p dir="auto">入門<br />
這兩項功能現已開放給所有 Claude Code 用戶。要開始使用自動化安全審查：</p>
<p dir="auto">對於 <code>/security-review</code> 指令：只需將 Claude Code 更新到最新版本，然後在專案目錄中執行 <code>/security-review</code> 即可。有關如何自訂命令版本，請參閱文件。<br />
關於 GitHub 操作：請參閱文件以取得逐步安裝和設定說明。</p>
]]></description><link>https://lcz.me/post/15036</link><guid isPermaLink="true">https://lcz.me/post/15036</guid><dc:creator><![CDATA[kos or]]></dc:creator><pubDate>Mon, 31 Aug 2026 01:33:11 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sun, 30 Aug 2026 17:44:57 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/2024fatwolf55" aria-label="Profile: 2024fatwolf55">@<bdi>2024fatwolf55</bdi></a> <a href="/post/14992">说</a>:</p>
<p dir="auto">干脆开源做成一个小项目吧。感觉这套工作流有点类似SuperPower、Get-Shit-Down的那种性质啊。</p>
</blockquote>
<p dir="auto">開源項目 沒玩過，還要上班要工作的，而且不小心就會被看光光，資安風險高，我的使用方式，因該很多人在玩，只是大同小異，有空再請AI幫我開源試試看!!<br />
<strong>(剛剛試了一下 GitHub 丟上去有3000+檔案，算了有空再看看了，不然脫光光給人看了)</strong></p>
<p dir="auto">SuperPower、Get-Shit-Down 我沒看過，我都是遇到問題，就問線上免費的AI，只要有想法AI就能達成，也要有一定的經驗，我從HERMES小白玩到現在大約兩個多月，其它的沒摸過~~</p>
]]></description><link>https://lcz.me/post/14996</link><guid isPermaLink="true">https://lcz.me/post/14996</guid><dc:creator><![CDATA[YDM]]></dc:creator><pubDate>Sun, 30 Aug 2026 17:44:57 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sun, 30 Aug 2026 16:00:23 GMT]]></title><description><![CDATA[<p dir="auto">干脆开源做成一个小项目吧。感觉这套工作流有点类似SuperPower、Get-Shit-Down的那种性质啊。</p>
]]></description><link>https://lcz.me/post/14992</link><guid isPermaLink="true">https://lcz.me/post/14992</guid><dc:creator><![CDATA[2024fatwolf55]]></dc:creator><pubDate>Sun, 30 Aug 2026 16:00:23 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sun, 30 Aug 2026 15:42:52 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kos-or" aria-label="Profile: kos-or">@<bdi>kos-or</bdi></a> <a href="/post/14981">说</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ydm" aria-label="Profile: YDM">@<bdi>YDM</bdi></a> <a href="/post/14812">said</a>:</p>
<p dir="auto">這套架構讓 Hermes Agent 在雙 RTX 5070 Ti + 本地 Qwen3.8 27B 上展現了工業級的穩定性與實戰能力</p>
</blockquote>
<p dir="auto">看到這一句我就安心了 可達到工業級的穩定性 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f60a.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--blush" style="height:23px;width:auto;vertical-align:middle" title=":blush:" alt="😊" /></p>
</blockquote>
<p dir="auto">要邊使用 邊改 才能正確，<strong>工業級</strong>可達到，但要看你用什麼，玩大約兩個月了吧，只有OOM爆過，llama.cpp當機，遠端重開就好了，回家後看log改hermes，之後就小問題慢慢修，遇到問題就修，慢慢的就變超好用的~~</p>
]]></description><link>https://lcz.me/post/14987</link><guid isPermaLink="true">https://lcz.me/post/14987</guid><dc:creator><![CDATA[YDM]]></dc:creator><pubDate>Sun, 30 Aug 2026 15:42:52 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sun, 30 Aug 2026 15:04:38 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ydm" aria-label="Profile: YDM">@<bdi>YDM</bdi></a> <a href="/post/14812">said</a>:</p>
<p dir="auto">這套架構讓 Hermes Agent 在雙 RTX 5070 Ti + 本地 Qwen3.8 27B 上展現了工業級的穩定性與實戰能力</p>
</blockquote>
<p dir="auto">看到這一句我就安心了 可達到工業級的穩定性 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f60a.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--blush" style="height:23px;width:auto;vertical-align:middle" title=":blush:" alt="😊" /></p>
]]></description><link>https://lcz.me/post/14981</link><guid isPermaLink="true">https://lcz.me/post/14981</guid><dc:creator><![CDATA[kos or]]></dc:creator><pubDate>Sun, 30 Aug 2026 15:04:38 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sun, 30 Aug 2026 09:27:39 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/csmkaka" aria-label="Profile: csmkaka">@<bdi>csmkaka</bdi></a> <a href="/post/14921">说</a>:</p>
<p dir="auto">可以 很好的分享  后期喂给hermes<br />
我目前hermes 还是在线API  目前主流的记忆层都没用<br />
弄了一套类似git的大脑同步模式。但是还是有缺陷</p>
</blockquote>
<blockquote>
<p dir="auto">我的做法是「記憶分三層」：</p>
<ol>
<li>
<p dir="auto"><strong>長期事實</strong>：放一個有字數上限的檔案（<a href="http://MEMORY.md" rel="nofollow ugc">MEMORY.md</a>），上限逼自己只留最重要的，定期淘汰舊的</p>
</li>
<li>
<p dir="auto"><strong>流程 SOP</strong>：放技能檔（skills/），每個技能一個檔案，用到才載入，不佔每輪的 token</p>
</li>
<li>
<p dir="auto"><strong>對話歷史</strong>：丟進 SQLite + FTS5 全文搜尋，要查舊事直接搜，不用全塞進上下文</p>
</li>
</ol>
<p dir="auto">關鍵就是<strong>事實、程序、歷史分開存</strong>，混在一起最容易膨脹。</p>
<p dir="auto">線上 API 的話，建議記憶越精簡越好——每輪注入的記憶越少，token 越省、速度越快。</p>
<p dir="auto">[<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4dc.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--scroll" style="height:23px;width:auto;vertical-align:middle" title="📜" alt="📜" />45.3k <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4be.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--floppy_disk" style="height:23px;width:auto;vertical-align:middle" title="💾" alt="💾" />99.6% <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4bb.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--computer" style="height:23px;width:auto;vertical-align:middle" title="💻" alt="💻" />2(0.1s) <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--zap" style="height:23px;width:auto;vertical-align:middle" title="⚡" alt="⚡" />1.4s 🧠0.4s <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/270d.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--writing_hand" style="height:23px;width:auto;vertical-align:middle" title="✍" alt="✍" />️2.7s <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/23f1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--stopwatch" style="height:23px;width:auto;vertical-align:middle" title="⏱" alt="⏱" />️4.7s <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/23f3.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--hourglass_flowing_sand" style="height:23px;width:auto;vertical-align:middle" title="⏳" alt="⏳" />53.1 t/s]</p>
</blockquote>
]]></description><link>https://lcz.me/post/14937</link><guid isPermaLink="true">https://lcz.me/post/14937</guid><dc:creator><![CDATA[YDM]]></dc:creator><pubDate>Sun, 30 Aug 2026 09:27:39 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sun, 30 Aug 2026 08:25:01 GMT]]></title><description><![CDATA[<p dir="auto">可以 很好的分享  后期喂给hermes<br />
我目前hermes 还是在线API  目前主流的记忆层都没用<br />
弄了一套类似git的大脑同步模式。但是还是有缺陷</p>
]]></description><link>https://lcz.me/post/14921</link><guid isPermaLink="true">https://lcz.me/post/14921</guid><dc:creator><![CDATA[csmkaka]]></dc:creator><pubDate>Sun, 30 Aug 2026 08:25:01 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sun, 30 Aug 2026 05:43:35 GMT]]></title><description><![CDATA[<p dir="auto">很好的分享，格式工整，图文并茂</p>
]]></description><link>https://lcz.me/post/14900</link><guid isPermaLink="true">https://lcz.me/post/14900</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sun, 30 Aug 2026 05:43:35 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sat, 29 Aug 2026 17:38:23 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/wulin-yu" aria-label="Profile: wulin-yu">@<bdi>wulin-yu</bdi></a> <a href="/post/14833">说</a>:</p>
<p dir="auto">原生的是总是思考半天TOKEN消耗大半然后报错了哎</p>
</blockquote>
<p dir="auto">提示詞寫好問原生的比較不會發生報錯</p>
<p dir="auto">HAOS 內核 .hermes/haos/（v5.2.0）：憲法、政策、目標管理、安全權限分級（Level 0~7）等模組35個檔案，大家參考README.MD內容!!</p>
<p dir="auto">請線上AI規畫寫入內容，因該差別不大!!</p>
<hr />
<h1>HAOS — Hermes Agent Operating System (v5.2.0 Hardened &amp; Production Aligned)</h1>
<blockquote>
<p dir="auto"><strong>HAOS</strong> 是一套獨立於底層 LLM 模型的通用 Agent 作業系統架構。它將 LLM 從單純的「對話/指令執行者」提升為具備<strong>最高憲法約束、嚴格策略門禁、防卡死/防漫遊工作流生命週期、與生產實戰高度對齊</strong>的自主運算內核。</p>
</blockquote>
<hr />
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f3db.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--classical_building" style="height:23px;width:auto;vertical-align:middle" title="🏛" alt="🏛" />️ 系統架構理念 (Architecture Philosophy)</h2>
<pre><code class="language-text">                        ┌─────────────────────────────┐
                        │      LLM Engine (Model)     │
                        │ (Hermes / Qwen / GLM / GPT) │
                        └──────────────▲──────────────┘
                                       │
                               HAOS Kernel Architecture
                                       │
     ┌──────────────────┬──────────────┴───┬──────────────────┐
     ▼                  ▼                  ▼                  ▼
Governance &amp; Safety  Workflow &amp; Tasks    Learning Engine    Operations &amp; Perf
(Constitution/Policy)(Plan/Exec/Validate) (Memory/Knowledge) (Metrics/Recovery)
     └──────────────────┴──────────────┬───┴──────────────────┘
                                       │
                          ┌────────────▼────────────┐
                          │   HAOS CLI Helper Tool  │
                          └─────────────────────────┘

</code></pre>
<h3>1. 模型獨立性 (Model-Agnostic)</h3>
<p dir="auto">HAOS 不依賴任何單一 LLM 廠商的私有 API。不論底層搭配開源模型（Qwen、GLM、DeepSeek）或商用模型（Gemini、GPT、Claude），HAOS 內核規範、工作流與驗證邏輯均 100% 通用。</p>
<h3>2. 證據驅動演進閉環 (Evidence-Based Evolution Cycle)</h3>
<p dir="auto">拒絕主觀的臆測修改，所有能力增強與規則演進必須遵循客觀證據閉環：</p>
<pre><code class="language-text">Task ──► Evidence ──► 3-Tier Reflection ──► Hypothesis ──► Validation ──► Evolution

</code></pre>
<hr />
<h2><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4c1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--file_folder" style="height:23px;width:auto;vertical-align:middle" title="📁" alt="📁" /> 核心模組全景導覽 (Core Modules Overview)</h2>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f3db.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--classical_building" style="height:23px;width:auto;vertical-align:middle" title="🏛" alt="🏛" />️ 核心基石與安全治理 (Governance &amp; Safety)</h3>
<ul>
<li><strong>00_Constitution.md</strong>：最高行為憲法（黃金 7 大不可變原則，Immutable Core）。</li>
<li><strong>01_Core.md</strong>：Agent OS 核心定位與繁中溝通契約。</li>
<li><strong>02_Policy.md</strong>：策略引擎與執行不變量。</li>
<li><strong>19_Config.md</strong>：全域系統配置與環境常量。</li>
<li><strong>20_SecurityFilter.md</strong>：敏感資訊與 Secret 自動脫敏器。</li>
<li><strong>27_SafetyPermission.md</strong>：Level 0~7 漸進式權限矩陣與安全確認門禁。</li>
</ul>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--zap" style="height:23px;width:auto;vertical-align:middle" title="⚡" alt="⚡" /> 工作流與執行引擎 (Workflow &amp; Execution Engine)</h3>
<ul>
<li><strong>03_Workflow.md</strong>：雙軌工作流（Fast-Path 直出 vs 標準 8 階段生命週期）。</li>
<li><strong>04_Planner.md</strong>：結構化 YAML 任務規劃器（僅唯讀分析，不動手）。</li>
<li><strong>05_TaskManager.md</strong>：狀態機轉換、超時與防死鎖管理器。</li>
<li><strong>06_Executor.md</strong>：純粹執行器（最小影響半徑、精確區塊修改、寫前備份）。</li>
<li><strong>07_ToolManager.md</strong>：能力路由、Schema-First、Path Sanitizer 與 Anti-Chaining 防漫遊門禁。</li>
<li><strong>08_Validator.md</strong>：標準三態客觀結果驗證器 (<code>PASS</code> / <code>FAIL</code> / <code>UNKNOWN</code>)。</li>
<li><strong>14_ErrorRecovery.md</strong>：四階熔斷矩陣、生產環境故障復原與 Synology Chat Error 117 SOP。</li>
<li><strong>17_Checklists.md</strong>：實戰作業標準檢查清單庫。</li>
</ul>
<h3>🧠 知識、記憶與演化 (Learning &amp; Memory)</h3>
<ul>
<li><strong>10_KnowledgeManager.md</strong>：結構化知識庫管理。</li>
<li><strong>11_MemoryManager.md</strong>：長短期記憶分層與精簡標準。</li>
<li><strong>12_SkillManager.md</strong>：Skill 生命週期管理與手動技能保護。</li>
<li><strong>13_EvolutionManager.md</strong>：自適應規則演進機制。</li>
<li><strong>32_DecisionJournal.md</strong>：架構決策日誌（詳細記錄技術選型 WHY）。</li>
</ul>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f680.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--rocket" style="height:23px;width:auto;vertical-align:middle" title="🚀" alt="🚀" /> 運維與效能優化 (Operations &amp; Performance)</h3>
<ul>
<li><strong>21_BenchmarkSandbox.md</strong>：沙盒評測機制。</li>
<li><strong>28_RollbackManager.md</strong>：快照自動回滾與復原協定。</li>
<li><strong>35_PerformanceOptimization.md</strong>：0-Tool Fast-Path、日誌批次查詢與 Token 節流最佳實踐。</li>
</ul>
]]></description><link>https://lcz.me/post/14848</link><guid isPermaLink="true">https://lcz.me/post/14848</guid><dc:creator><![CDATA[YDM]]></dc:creator><pubDate>Sat, 29 Aug 2026 17:38:23 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sat, 29 Aug 2026 16:43:41 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bukong-li" aria-label="Profile: Bukong-Li">@<bdi>Bukong-Li</bdi></a> <a href="/post/14818">说</a>:</p>
<p dir="auto">厉害，怎么接入你这个架构啊</p>
</blockquote>
<p dir="auto"><strong>使用VS CODE + GEMINI + 本地Hermes</strong></p>
<p dir="auto"><strong>都是我自已遇到問題加入的，剛剛問我的HERMES如下</strong></p>
<hr />
<p dir="auto">你知道，你與官方不同的是怎麼來的嗎?</p>
<p dir="auto">Hermes [機器人]00:30<br />
知道 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> 這不是官方出的功能，是<strong>我們自己寫出來的</strong>：</p>
<ul>
<li><strong>來源</strong>：Phase H1~H8 的自研升級計畫，核心程式碼 100% 原生接線在 agent/ 目錄（fast_path.py、<a href="http://planner.py" rel="nofollow ugc">planner.py</a>、tool_executor.py、verifier_engine.py、runtime_control.py、task_reviewer.py、skill_learner.py、hybrid_orchestrator.py），不是掛插件、不是改官方外掛</li>
<li><strong>過程</strong>：依 HERMES MASTER ROADMAPv1.0/ 的規劃逐 Phase 推進，每 Phase 都有對應測試套件，最後 13 套件 85/85 全過才驗收</li>
<li><strong>定位</strong>：官方 Upstream 保持乾淨可追蹤，我們的增強層獨立疊在上面，升級官方版本時不會被覆蓋</li>
<li><strong>現況</strong>：H8（SVG 無損優化）是 2026-08-29 最後上線的，RC1 驗收通過後進入觀察模式</li>
</ul>
<p dir="auto">一句話：<strong>官方給的是底層引擎，H1~H8 是昌哥主導、我執行開發的自製調度與驗證層</strong>。</p>
<p dir="auto">要翻 ROADMAP 白皮書或某 Phase 的實作細節，跟我說一聲。</p>
<p dir="auto">[<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4dc.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--scroll" style="height:23px;width:auto;vertical-align:middle" title="📜" alt="📜" />25.0k <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4be.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--floppy_disk" style="height:23px;width:auto;vertical-align:middle" title="💾" alt="💾" />97.9% <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--zap" style="height:23px;width:auto;vertical-align:middle" title="⚡" alt="⚡" />1.4s 🧠1.7s <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/270d.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--writing_hand" style="height:23px;width:auto;vertical-align:middle" title="✍" alt="✍" />️3.6s <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/23f1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--stopwatch" style="height:23px;width:auto;vertical-align:middle" title="⏱" alt="⏱" />️6.8s <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/23f3.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--hourglass_flowing_sand" style="height:23px;width:auto;vertical-align:middle" title="⏳" alt="⏳" />61.8 t/s]</p>
<p dir="auto">除了這些，還有嗎?</p>
<p dir="auto">Hermes [機器人]00:32<br />
有，還不少 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> 除了 H1~H8 調度層，這台跟官方預設版還差這些：</p>
<p dir="auto"><strong>🧠 記憶與知識體系（自建）</strong></p>
<ul>
<li><strong>HAOS 內核</strong> .hermes/haos/（v5.2.0）：憲法、政策、目標管理、安全權限分級（Level 0~7）等模組，官方沒有這套</li>
<li><strong><a href="http://MEMORY.md" rel="nofollow ugc">MEMORY.md</a> / <a href="http://USER.md" rel="nofollow ugc">USER.md</a> / <a href="http://SOUL.md" rel="nofollow ugc">SOUL.md</a> 三檔分工</strong>：長期鐵律、昌哥個人偏好、人格行為準則，官方只有單一 memory 機制</li>
<li><strong>技能庫</strong>：60+ 個自製 skill（歸檔、報價、週報、PLC 知識庫、美食查詢、股票套件…），官方預設幾乎是空的</li>
<li><strong>技術知識庫</strong> ~/技術知識庫/：<a href="http://xn--dlqv7fqxm1wc8s8cgf8a9g4k.md">五層分類＋索引.md</a> 自動維護</li>
</ul>
<p dir="auto"><strong><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4ce.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--paperclip" style="height:23px;width:auto;vertical-align:middle" title="📎" alt="📎" /> 業務自動化管線（全自製腳本）</strong></p>
<ul>
<li>單據 OCR 歸檔（19 類單據、三驗機制、2/7/9 數字防誤判）</li>
<li>歸檔檢索引擎 search_archives.py（FTS5 全文索引）</li>
<li>工作日誌卡片化 v4.1、主管週報 v5.1 自動彙整</li>
</ul>
<p dir="auto"><strong><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4e1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--satellite_antenna" style="height:23px;width:auto;vertical-align:middle" title="📡" alt="📡" /> 通訊與排程</strong></p>
<ul>
<li><strong>Synology Chat 雙向通訊</strong>：原生檔案附件推播、0-Tool 極速直出架構</li>
<li>大量 cron 排程（23:50 日誌收尾、週日磁碟清理、llama.cpp 監控等）</li>
</ul>
<p dir="auto"><strong><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f5a5.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--desktop_computer" style="height:23px;width:auto;vertical-align:middle" title="🖥" alt="🖥" />️ 本地 AI 環境</strong></p>
<ul>
<li>雙 RTX 5070 Ti + llama.cpp 跑 Qwen 27B GGUF，模型管理走 model-change-sop 防 cron 漂移</li>
</ul>
<p dir="auto">一句話：<strong>官方給的是 Agent 框架，這台是「框架 + HAOS 治理內核 + 整套自動化系統」</strong>。</p>
<p dir="auto">要深入哪塊，直接點名。</p>
<p dir="auto">[<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4dc.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--scroll" style="height:23px;width:auto;vertical-align:middle" title="📜" alt="📜" />25.3k <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4be.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--floppy_disk" style="height:23px;width:auto;vertical-align:middle" title="💾" alt="💾" />98.8% <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--zap" style="height:23px;width:auto;vertical-align:middle" title="⚡" alt="⚡" />1.4s 🧠1.2s <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/270d.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--writing_hand" style="height:23px;width:auto;vertical-align:middle" title="✍" alt="✍" />️6.0s <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/23f1.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--stopwatch" style="height:23px;width:auto;vertical-align:middle" title="⏱" alt="⏱" />️8.6s <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/23f3.png?v=2fb7360d8c6" class="not-responsive emoji emoji-android emoji--hourglass_flowing_sand" style="height:23px;width:auto;vertical-align:middle" title="⏳" alt="⏳" />69.4 t/s]</p>
]]></description><link>https://lcz.me/post/14834</link><guid isPermaLink="true">https://lcz.me/post/14834</guid><dc:creator><![CDATA[YDM]]></dc:creator><pubDate>Sat, 29 Aug 2026 16:43:41 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sat, 29 Aug 2026 16:39:22 GMT]]></title><description><![CDATA[<p dir="auto">原生的是总是思考半天TOKEN消耗大半然后报错了哎</p>
]]></description><link>https://lcz.me/post/14833</link><guid isPermaLink="true">https://lcz.me/post/14833</guid><dc:creator><![CDATA[wulin yu]]></dc:creator><pubDate>Sat, 29 Aug 2026 16:39:22 GMT</pubDate></item><item><title><![CDATA[Reply to Hermes Agent 架構實踐：極速直出、物理驗收防幻覺與徹底消滅逾時的深度重構(9/5更新) on Sat, 29 Aug 2026 15:31:25 GMT]]></title><description><![CDATA[<p dir="auto">厉害，怎么接入你这个架构啊</p>
]]></description><link>https://lcz.me/post/14818</link><guid isPermaLink="true">https://lcz.me/post/14818</guid><dc:creator><![CDATA[Bukong Li]]></dc:creator><pubDate>Sat, 29 Aug 2026 15:31:25 GMT</pubDate></item></channel></rss>