跳到主要內容

發表文章

目前顯示的是有「AI」標籤的文章

eBPF 為什麼不能隨便讀記憶體?看懂 Linux Verifier 的安全檢查 / Why the Linux eBPF Verifier Refuses Unsafe Memory Access

daily-tech:2026-11-16 現象:一個指標,為什麼不能直接讀? / Symptom: Why can’t one pointer simply be read? 寫 eBPF 時,最容易踩到的坑不是語法,而是「我明明先算出位址,為什麼載入核心就被拒絕?」原因是 eBPF 程式會在核心內執行;Linux 不能等錯誤發生後才補救,因此載入前先由 verifier 檢查指標型別、數值範圍、對齊與控制流程。 When writing eBPF, the frustrating failure is often not syntax: “I calculated the address, so why did the kernel reject the program?” eBPF runs inside the kernel. Linux therefore checks pointer types, value ranges, alignment, and control flow before loading instead of repairing a fault afterward. 機制:verifier 追蹤的是狀態,不是猜測 / Mechanism: the verifier tracks states, not guesses 官方文件把暫存器分成 scalar 與多種 pointer。scalar 會保存最小、最大值與未知位元;指標則帶著來源與可存取範圍。以封包為例,先取出 data 與 data_end,再確認 data 加上標頭長度沒有越過 data_end,之後那個分支內的讀取才被視為安全。若中間把指標做成無法證明範圍的運算,狀態會退化成 scalar,後面的記憶體讀取就會失效。 The kernel documentation describes registers as scalars or several pointer types. A scalar carries bounds and unknown bits; a pointer carries its origin and an accessible range. For packet data, the program loads data and data_end,...

Linux io_uring 為什麼仍可能卡住?從固定 Buffer 到 Completion Queue 的 I/O 路徑 / Why Linux io_uring Can Still Stall: Fixed Buffers and Completion Queues

 現象:io_uring 非同步,為什麼服務仍會卡住? / Symptom: Why can an io_uring service still stall? 你把大量檔案讀取改成 Linux io_uring,CPU 使用率下降,卻仍看到請求延遲突然拉高。提交請求變得非同步,不代表儲存裝置立刻完成;queue depth、檔案系統與 block I/O 仍會把等待時間留在 completion 之前。 You moved file reads to Linux io_uring, CPU usage fell, yet request latency still spikes. Submission becomes asynchronous; storage, the filesystem, and block I/O can still delay completion. io_uring 的基本路徑是:應用程式準備 submission queue entry(SQE),核心取出並執行,最後把結果寫成 completion queue entry(CQE)。共享 ring 減少系統呼叫,但 CQE 的 res 才是實際結果;不能只看到 SQE 已提交,就把工作算成完成。 The path is: the application prepares an SQE, the kernel executes it, and a CQE reports the result. Shared rings reduce syscall traffic, but CQE res is the real outcome. Submission is not completion. 圖一|io_uring 的 SQE→核心執行→CQE 路徑;固定 buffer 的生命週期與完成延遲必須分開觀察。 / Figure 1 | The SQE-to-kernel-to-CQE path; buffer lifetime and completion latency are separate signals. Original conceptual diagram. 機制:固定 Buffer 解決什麼,又帶來什麼責任? / Mechanism: what registered bu...

Linux 為什麼還沒 OOM 就開始卡頓?用 PSI 讀懂 CPU、記憶體與 I/O 壓力 / Before OOM: Reading Linux Pressure Stall Information

現象:為什麼還沒 OOM 就開始卡? / Symptom: Why does Linux stall before OOM? 你是否遇過這種情況:記憶體還有剩、CPU 也沒有 100%,但 SSH 變慢、服務延遲突然拉高,甚至工作負載尚未被 OOM Killer 終止就已經「像死機」?這不是單看使用率就能回答的問題。Linux Pressure Stall Information(PSI)量的是工作真的因資源不足而等待了多久,讓「還能跑」與「已經在浪費時間」分開。 Have you seen a Linux host become sluggish while memory is still available and CPU is below 100%? PSI addresses the missing signal: not how full a resource looks, but how long runnable work is actually delayed by contention. A machine can be operational and already wasting latency before the OOM killer appears. PSI 的核心不是額外的效能計數器,而是把資源競爭轉成「停滯時間」。核心分別在 /proc/pressure/cpu、memory、io 匯出資料;some 表示至少一部分工作正在等待,full 則表示所有非閒置工作同時卡住。memory full 或 io full 長時間上升,比單獨看到 free 變少更接近「系統正在失去生產力」的現象。 PSI turns contention into stall time. The kernel exports cpu, memory, and io pressure files under /proc/pressure. “some” means at least some work is stalled; “full” means all non-idle work is stalled at once. A sustained memory-full or io-full signal is often more actionable tha...

從聊天機器人到工作夥伴:下一世代 AI Agent 的沙盒化與品質保證

Beyond chat responses: Mastering the architecture for reliable, production-grade AI agents. 🔎 工具速覽 / AT A GLANCE Category AI Workflow Orchestration / MLOps Pricing Open Source / Enterprise Custom BestFor 需要將 AI 能力整合到企業 CI/CD 流程的團隊 GitHub Stars ⭐ 276 🚀 引言 / Introduction 大家是不是覺得,現在的 AI 聊天機器人(LLM)已經很厲害了?只要問它個問題,它都能給你一個看似完美、字斟句酌的答案。但當我們把這些 AI 想像成真正的「員工」,讓它去處理複雜的商業流程——比如寫一個需要跑測試的 PR、或是生成一個完整的網站介面時,大家會開始遇到一個問題:它給的答案,怎麼確定是『對的』?它有沒有偷偷跑掉資料庫的順序?它寫的程式碼,有沒有隱藏的資安漏洞?這就是目前 AI Agent 的真正『阿基里斯腱』:從 '答案' 到 '可靠的產出' 的鴻溝。這時候,我們不能再把 AI 當成一個聰明的聊天窗口了,它必須是一個擁有自身工作站、能執行、能回溯、更能經得起專業『品質檢驗』的『數位員工』。本文要聊的,就是如何建立這樣一套工業級的 Agent 運作框架。 🛠️ 核心功能 / Key Features 我們看的是像 useagent 這類架構的崛起。它最大的創新點,已經遠遠超過了單純的 Prompt Engineering。它提供的是一個完整的『數位工作空間』概念,這不是一個 API Call,而是一個持續、可追蹤的『事件流』(Event-sourced timeline)。想像一下,它給你的不只是一個 JSON 回應,而是一個完整的、帶有生命週期的工作成果:一個跑完測試的 PR、一個可即時預覽的網站...

別讓 AI Agent 把你的 Repo 搞崩:從『風險評估』導向的開發新範式 | Stop Letting AI Agents Wreck Your Repo: The Evaluation-First Development Paradigm

在 AI 瘋狂寫 Code 之前,先給它一套『生存守則』。| Before the AI goes wild with code, give it a set of 'Survival Rules'. 🔎 工具速覽 / AT A GLANCE Category AI Agent Governance / Software Engineering Pricing Open Source (Free) BestFor Enterprise repos, Open source maintainers, Teams adopting AI coding agents GitHub Stars ⭐ 22 🚀 引言 / Introduction (前輩咖啡時間 ☕️) 各位在第一線肝 Code 的工程師,你們有沒有遇過這種狀況:老闆看完某個 AI Demo 後,眼睛發光地跟你說:『欸,現在 AI 這麼強,我們直接把 Agent 丟進 Production Repo,讓它幫我們把那疊修不完的 Bug 全解決掉吧!』 當時你可能在喝下午茶雞排,差點被嗆到。因為身為系統設計顧問,我太清楚 AI Agent 的『毀滅性』了。它們就像個極其勤奮但完全沒有常識的實習生,如果不給它明確的邊界(Guardrails),它能用最優雅的語法,幫你把整個系統優化到『完全跑不動』。目前的 AI Coding 工具大多專注於『如何寫快』,卻很少有人討論『如何安全地寫』。這就是為什麼我最近在關注 `agent-workflow-kit`。它不提供新的 LLM,而是提供一套『風險評估』的邏輯,告訴你:在 AI 觸碰你的代碼之前,你應該設定多少級別的限制。這不是在阻礙效率,而是在救你的肝。 🛠️ 核心功能 / Key Features ### 核心功能:從『盲目信任』轉向『量化評估』 `agent-workflow-kit` 的核心邏輯非常簡單且暴力:**Evaluation-first(評估先行)**。它不再讓 AI 直接跳進 Codebase,而是強迫開發者先走一遍這套流程: 1. **風險評分 (Risk Scoring 0-16)**:它提供一套指標,幫你判斷這個 Repo 是『玩具專案』還是『觸之即崩的核電廠』。根據複雜度、依賴關係和影響...

別再被 API Key 搞到肝指數爆表:用 ai-relay 打造你的 Serverless AI 流量調度中心 | Stop API Key Burnout: Building Your Serverless AI Traffic Hub with ai-relay

從繁瑣的 Key 管理到一鍵部署的 Edge Gateway,讓 AI 整合不再是維運的噩夢。 | From tedious key management to a one-click Edge Gateway, making AI integration a dream instead of an Ops nightmare. 🔎 工具速覽 / AT A GLANCE Category AI Infrastructure / API Gateway Pricing Free (Vercel Free Tier compatible) BestFor Indie Hackers, Small Teams, AI App Developers GitHub Stars ⭐ 40 🚀 引言 / Introduction 各位在科技業摸爬滾打的工程師,你們應該對這種場景不陌生:老闆今天突然說『DeepSeek 好像比較快,把後端換掉』,或者某個 Provider 突然 500 噴到你懷裡,而你得在半夜三點趕快去改環境變數、重啟 Docker,然後在 Slack 上對著 PM 微笑說『正在優化中』。這種日子真的太肝了! 其實,我們缺的不是更強的 Model,而是一個能讓我們『躺平』的流量調度層。今天要聊的 ai-relay,就是把這層複雜的路由、Key 輪詢和故障轉移,全部塞進了 Vercel Edge Runtime。不用買 VPS、不用管 K8s,只要兩分鐘,你就能擁有一個讓所有 AI SDK 乖乖聽話的 API 中轉站。這不是在偷懶,這是在拯救我們的肝指標! For those of us surviving in the tech trenches, the scenario is familiar: the boss decides on a whim that 'DeepSeek seems faster, switch the backend,' or a provider starts throwing ...

別讓你的 AI 寫出 2018 年的 Kotlin:Compose-Kotlin-Agent-Skills 的革命性對齊 / Stop Your AI from Writing 2018-era Kotlin: The Revolutionary Alignment of Compose-Kotlin-Agent-Skills

將 AI 從『會寫程式碼』提升到『懂現代 Android 架構』的知識注入方案 / Elevating AI from 'writing code' to 'understanding modern Android architecture' via knowledge injection. 🔎 工具速覽 / AT A GLANCE Category AI Agent Knowledge Base / LLM Alignment Pricing Open Source (MIT) BestFor Android/KMP Developers using Cursor, Claude Code, or Gemini GitHub Stars ⭐ 23 🚀 引言 / Introduction 各位肝指數快爆表的 Android 工程師們,你們一定遇過這種情況:請 Cursor 或 Claude 幫你寫個 Compose 畫面,結果它給你的代碼竟然還在用三年前的過時語法,甚至把 State 搞得一團亂,最後你得花兩小時在那邊修 Bug,還得面對老闆問你『為什麼這個簡單的功能要這麼久?』。這就是典型的『AI 幻覺』與『知識滯後』。AI 雖然讀過整個 GitHub,但它並不真正『理解』現代 Android 的嚴格規範(如 K2 編譯器或 Compose 2026 的預期方向)。 Today, we're talking about a game-changer: `compose-kotlin-agent-skills`. This isn't just another prompt library; it's a systemic 'knowledge injection' framework. Instead of begging your AI to 'please use MVI' in every single chat, this proj...

別讓你的專案得『失智症』:SpiderBrain V3 如何用圖論拯救 AI 時代的 Token 焦慮 | Stop Project Alzheimer's: How SpiderBrain V3 Uses Graph Theory to Cure Token Anxiety

用外部化依賴圖譜為 AI 建立『第二大腦』,將昂貴的 Token 轉化為精準的結構化記憶。 | Externalizing project structure into a graphed second brain to turn expensive tokens into precision structured memory. 🔎 工具速覽 / AT A GLANCE Category AI Engineering / Knowledge Graph Pricing BUSL-1.1 (Free for OSS/Edu/Research) BestFor Large-scale legacy codebases, AI-driven development teams, Complex Microservices GitHub Stars ⭐ 40 🚀 引言 / Introduction 各位在業界肝到深夜的工程師,你們有沒有過這種經驗:明明是一個小 Bug,但因為專案太大,你把整個 codebase 塞給 Claude 或 Cursor,結果 AI 居然開始『胡言亂語』(Hallucination),或者直接告訴你『對不起,我的上下文視窗滿了』?這就是典型的『專案失智症』(Project Alzheimer's)。我們以為 AI 懂我們的程式碼,但其實它只是在海量 Token 中抽機率。每次對話都要重新解釋一次『為什麼這個檔案在那裡』,簡直比跟產品經理(PM)對需求還要累。這時候,SpiderBrain V3 就像是給 AI 裝了一顆外部硬碟,讓它不再靠『猜』,而是靠『圖』來理解你的系統。 Ever felt the pain of feeding a massive codebase into Claude or Cursor, only for the AI to start hallucinating or hit the context limit? That's 'Project Alzh...

Stop the AI Chaos: Why 'Spec-Driven Development' is the New Survival Guide for Devs / 終結 AI 混亂:為什麼『規格驅動開發』是開發者的生存指南

Aligning your AI army with a single source of truth before the first line of code. / 在寫第一行程式碼前,讓你的 AI 大軍達成共識。 🔎 工具速覽 / AT A GLANCE Category AI Workflow Optimization / AI 工作流優化 Pricing Open Source (MIT) / 開源 BestFor Multi-AI tool users, System Architects, Overworked Lead Devs / 多 AI 工具使用者、系統架構師、被 Bug 搞到快崩潰的主導開發者 GitHub Stars ⭐ 37 🚀 引言 / Introduction 如果你最近的開發流程是:先叫 Claude Code 寫個功能 $\rightarrow$ 發現跑不起來 $\rightarrow$ 把 code 丟給 Cursor 修 $\rightarrow$ 結果 Cursor 把原本正確的邏輯給改掉 $\rightarrow$ 最後用 Copilot 嘗試修復但結果變成三方混戰,恭喜你,你正處於『AI 幻覺同步災難』中。這感覺就像在公司裡面對三個不同老闆,一個要 A,一個要 B,另一個說『我覺得 C 比較酷』,而你只能在中間肝到凌晨三點,配著冷掉的雞排在螢幕前質疑人生。根本問題在於:你的 AI 代理人之間沒有『單一事實來源 (Single Source of Truth)』。Spec-Driven-Development (SDD) 專案正是為了解決這個痛點而生。它不再是讓 AI 直接『盲寫』,而是強迫 AI 在動手前先完成一份詳細的 Spec,讓所有 AI 工具在同一個認知框架下運作。 If your current workflow looks like this: ask Claude Code to build a feature $\rightarrow$ it fails $\righ...