Skip to content
Hiep Lam

Archives

All the articles I've archived.

2026 99
August 21
July 56
June 17
  • grep, BM25, semantic - ba tầng tìm kiếm, không phải hai

    🇻🇳 VI

    Phần 2 của series gộp grep và BM25 chung một rổ "lexical". Đúng, nhưng chúng không giống nhau: grep là cái lọc, BM25 là cái xếp hạng, còn semantic mới là cái hiểu nghĩa. Tui mổ một con tool thật cố tình chọn BM25 và bỏ vector, kèm demo Go chấm điểm BM25 chạy thật, output verbatim.

  • Chữ "semantic": một chữ, hai thế giới - và tại sao ta hay lộn

    🇻🇳 VI

    Mục lục một series nhỏ gỡ rối chữ "semantic". Tại sao "tool này không có semantic search" và "Roslyn có semantic model" là HAI chữ semantic khác nhau, cùng dính gì tới AST, và vì sao tầng ngữ nghĩa lại là cái harness ghì cương được AI agent. Code Go chạy được, C# đối chiếu, mọi khẳng định có nguồn.

  • Cú pháp vs Ngữ nghĩa: AST thật ra là gì (và không là gì)

    🇻🇳 VI

    Phần 1 - Mổ xẻ abstract syntax tree (cây cú pháp trừu tượng). Chạy go/ast thật, chứng minh AST chỉ biết hình dạng code chứ không biết kiểu, không biết giá trị, không biết cái tên trỏ tới đâu. Đặt nền cho tầng semantic ở Phần 3.

  • "Tool này không có semantic search" - chữ semantic kiểu embeddings

    🇻🇳 VI

    Khi ai đó nói "tool này không có semantic search", họ đang nói về embeddings và cosine similarity - hoàn toàn khác chữ semantic của compiler. Bài này tách hai thế giới đó ra, chạy demo Go minh hoạ cơ chế cosine, và giải thích tại sao hai chữ "semantic" này chỉ chung gốc Hy Lạp chứ không chung máy móc gì hết.

  • "Roslyn có semantic model" - tầng nghĩa dựng trên AST

    🇻🇳 VI

    Phần 3: Semantic model của compiler là gì, và nó KHÔNG phải AST được tô màu. Demo Go chạy thật: cùng tên "x" nhưng shadowing cho ra 2 biến khác nhau - go/types phân giải chính xác từng chỗ dùng qua side-map riêng. Đối chiếu Roslyn (C#): 3 tầng SyntaxTree / Compilation / SemanticModel và cách gọi đúng API.

  • Lấy AST viết hard-rule: cái lint nhỏ mà chặn được code sai

    🇻🇳 VI

    Dùng AST và tầng semantic (go/types) để viết luật lint cứng - cái chặn build thật sự. Demo Go: luật cấm import thì AST đủ, nhưng luật cấm os.Getenv phải có go/types mới không dính oan f.Getenv.

  • Ghì cương AI agent bằng kiến trúc, không bằng lời dặn

    🇻🇳 VI

    Kết series "Giải mã chữ semantic": tầng ngữ nghĩa (semantic model) + lint AST trở thành cái harness máy móc ghì cương AI coding agent. Tại sao lời dặn trong markdown lờ được, còn compiler + type-checker thì không. Phân biệt grammar-constrained decoding (chặn lúc sinh token) vs analyzer/lint (hậu kiểm ngữ nghĩa) - hai thứ bổ sung, không thay nhau.

  • Inside the Brainstorming Skill, Part 0: The Map

    🇺🇸 EN

    A top-down tour of the Superpowers brainstorming skill - the hard gate that stops premature code, the nine-step checklist, and the single legal exit. The whole machine on one page before we drill into the Socratic core.

  • Inside the Brainstorming Skill, Part 1: Dialogue, Not Interrogation

    🇺🇸 EN

    The six principles that shape every question the brainstorming skill asks - one at a time, multiple-choice preferred, YAGNI-ruthless - and the three targets each question is secretly aiming at: purpose, constraints, success criteria.

  • Inside the Brainstorming Skill, Part 2: The Interview Engine

    🇺🇸 EN

    The Socratic drill-down. How the brainstorming skill converts a vague idea into a buildable design through a single tight loop - scope triage, pick the next unknown, ask exactly one question, end the turn, integrate, and test for convergence. The mechanism, step by step.

  • Inside the Brainstorming Skill, Part 3: From Answers to Design

    🇺🇸 EN

    Once the Socratic interview converges, the skill stops asking and starts proposing - but never all at once. How it floats 2–3 approaches recommendation-first, then ratifies the design one section at a time.

  • Inside the Brainstorming Skill, Part 4: The Spec Pipeline

    🇺🇸 EN

    A validated design isn't the finish line. The skill writes it to a dated, committed spec, reviews it with fresh eyes, optionally dispatches a reviewer subagent, and then stops at a hard human gate before handing off to writing-plans.

  • Inside the Brainstorming Skill, Part 5: The Visual Companion

    🇺🇸 EN

    Some questions are clearer shown than told. The brainstorming skill can open a browser tab and ask its Socratic questions as clickable mockups - but only when it's earned, only one screen per turn, offered just-in-time and decided per question.

  • Inside the Brainstorming Skill, Part 6: Under the Hood

    🇺🇸 EN

    An appendix. Parts 0–5 documented what the brainstorming skill does; this one opens the visual companion and looks at the machinery - a zero-dependency Node server with a hand-rolled WebSocket, a filesystem seam between the agent and the browser, and a security model for a localhost server that might not stay on localhost.

  • Claude Code: Dynamic Workflow vs Subagent - phân biệt đầy đủ

    🇻🇳 VI

    Khi nào Claude Code dùng subagent, khi nào dùng dynamic workflow? Khác biệt cốt lõi nằm ở chỗ 'ai giữ kế hoạch'. Tổng hợp có dẫn nguồn về cơ chế kích hoạt, vòng đời, Script API, và các quality pattern của workflow, kèm một thí nghiệm 2 session thực tế.

  • Cross-Cutting Concern trong Lập Trình: tại sao logging, security, transaction lại làm rối code và cách tách chúng ra

    🇻🇳 VI

    Cross-cutting concern là những yêu cầu kỹ thuật (logging, security, transaction, caching...) xuyên suốt nhiều module nhưng không thuộc logic nghiệp vụ nào. Bài viết giải thích vì sao chúng gây tangling/scattering và các kỹ thuật tách chúng ra (AOP, middleware, MediatR behavior, decorator, DI interceptor).

  • Khi Agent "Đi Đường Tà Đạo": Phân tích chuyên sâu các failure mode của Agentic AI trong long-running task

    🇻🇳 VI

    Vì sao agent LLM chạy tác vụ dài hơi lại lười, lo âu, trôi mục tiêu và cắt góc khi bị hối - một tổng hợp các failure mode (chế độ lỗi) cùng cơ chế gốc rễ và chiến lược giảm thiểu, có dẫn nguồn.

May 5