三只貓
Rich Mindset Zone
richmindsetzone.com
← All posts

開源 AI IDE 戰國時代

2026 年嘅 AI IDE 戰場,已經唔係「邊個模型寫 code 最叻」嘅問題。Cursor 用 VS Code fork 嘅壟斷地位被 Codex CLI 嘅 Rust 重寫同開源策略撼動,而 Sinew 呢個後生嘅 open-source project 用 dependency graph 做 structural memory layer,靜靜起咗另一條戰線。三者嘅設計取捨揭示咗一個更深層嘅趨勢:AI IDE 正從「模型 wrapper」徹底轉型做「agent orchestration platform」,而呢場轉型嘅贏家,將會係嗰個最懂處理 agent 之間 coordination 嘅平台。

Sinew 嘅 structural memory:被低估嘅 agent infrastructure layer

Sinew 嘅核心判斷好特別:佢唔係另一個 AI coding agent,而係 agent 嘅 infrastructure layer。佢將任何 codebase parse 成 dependency graph——每個 node 係一個 function、class、module,每條 edge 係 import、call、inherit 關係——然後將成個 graph 儲存為 sinew.json。所有 agent 操作都 query 呢個 graph,唔使每次都 re-parse codebase。

呢個設計解決咗一個好現實嘅問題:AI agent 嘅 session memory 係零。每次開新 session,agent 唔知 codebase 有咩 function、有咩 convention、之前犯過咩錯。Sinew 嘅 agent-boot command 可以在 1,000 tokens 內俾到任何 agent 完整的 structural orientation。佢嘅 territory map 機制更讓多個 agent 同時操作同一 codebase 時唔會互相踩到——每個 agent claim 一個 territory,其他 agent 知道邊度唔可以寫。

比起 Cursor 嘅 context engine(用 Tree-sitter 做 AST parsing 然後 embed 入 vector DB),Sinew 嘅 approach 更似「shared ground truth」而非「retrieval」。Cursor 嘅問題在於:每次 query 都係一次近似搜尋,可能 miss 咗關鍵嘅 dependency。Sinew 嘅 graph 係 deterministic 嘅——你要搵某個 function 嘅 caller,graph 已經知道答案,唔使 semantic search。呢個差異喺複雜嘅 multi-step refactoring 入面特別明顯:Cursor 有時會 hallucinate 唔存在嘅 function,Sinew 嘅 verify command 可以直接 cross-check agent output 同 graph,即時 detect hallucination。

Cursor 3.0 嘅 agent-first 轉型:worktree isolation 係真功夫

Cursor 3.0 嘅最大改變唔係 UI,而係 architecture 底層從 single-session assistant 變成了 orchestration layer for parallel autonomous agents。Agent Window 取代咗 Composer panel,Git worktree isolation 讓多個 agent 可以喺同一 repo 上獨立運行。

最值得關注嘅係 /best-of-n 機制:將同一個 prompt 派俾多個 model(例如 GPT-5 同 Claude Sonnet),各自喺獨立 worktree 入面實行,然後由一個 Conductor agent 分析 tradeoffs,俾開發者揀最佳方案。呢個唔單止係「多 model 投票」,而係將開發者角色從「寫 code」轉變成「evaluate solution」——呢個 shift 對 senior engineer 嚟講係 empowerment,對 junior 嚟講係 cognitive load 嘅轉移。

但 Cursor 嘅根本限制係 closed-source。佢嘅 context engine、speculative edits、Tab RL——呢啲全部都係 proprietary。開發者可以用的係 surface-level 嘅功能,而唔係 infrastructure。當你嘅 workflow 深度依賴一個 closed platform,你嘅每個 productivity gain 都伴隨 vendor lock-in 嘅風險。

Codex CLI:OpenAI 嘅開源 counter-punch 同 context compaction 哲學

Codex CLI 被重寫為 Rust(codex-rs,65 個 member crates,142 個 dependencies)之後,成個 project 嘅 architecture 變得異常清晰:ThreadManager 管理多個 CodexThread 嘅 lifecycle,ToolRouter 處理 tool dispatch,sub-agent 通過 AgentControl 進行 spawn。

Codex 嘅 context compaction system 係佢最有特色嘅設計。當 token 超過 threshold,佢會 call OpenAI 嘅 /responses/compact endpoint,返回一個 AES-encrypted 嘅 opaque blob。呢個 blob 保留咗模型嘅 latent understanding,但 client 完全睇唔到入面嘅內容。相比之下,Claude Code 嘅 compaction 係 human-readable markdown——你可以睇到 model summarised 咗啲咩。

呢個 design tradeoff 好有意思:OpenAI 用 encryption 換 performance 同 security(防止 prompt injection via summary),但代價係 transparency。對於香港嘅 startup 嚟講,如果你的 codebase 有 IP sensitivity,用一個 encrypted blob 做 context compaction 可能係好事——冇人(包括你自己)睇到個 summary。但如果你需要 debugging 點解 agent 忘記咗某個關鍵 context,呢個 opacity 就會好頭痛。

Agent Swarm 生態:下一個競爭維度

真正有趣嘅係,以上三個平台都在向同一個方向移動:multi-agent coordination。Cursor 有 worktree isolation + Conductor agent,Codex 有 AgentControl + sub-agent spawning,Sinew 有 territory map + MCP server integration。

但 Sinew 嘅 approach 最接近「platform play」:佢唔係一個 IDE,而係一個可以俾任何 agent(Cursor、Codex、Claude Code)共用嘅 structural layer。Sinew expose 咗 MCP server,任何 MCP-compatible 嘅 agent tool 都可以 query 個 graph。呢個 neutrality 可能係佢最大嘅優勢——喺一個開發者同時用 Cursor 做 frontend、Codex CLI 做 backend 嘅世界,一個共享嘅 structural memory layer 變得越來越重要。

對於香港嘅獨立開發者同 startup team,我嘅建議係:唔好押注喺單一 platform。用 Cursor 做日常開發,用 Codex CLI 做 CI/CD pipeline 同 automation,同時將 Sinew 嘅 dependency graph 作為你嘅 codebase ground truth。Agent 會嚟會去,但你的 codebase structure 係你嘅——擁有呢個 structural layer 嘅 control,先係長遠之計。

AI IDE 嘅戰國時代先剛剛開始。Cursor 有 distribution,OpenAI 有模型同 infrastructure,Sinew 有 structural layer。最後贏家可能唔係任何一個 IDE,而係嗰個俾 developer 最大自由度嘅 ecosystem。