关于About
不再亲手写代码之后After I stopped writing code by hand
现在在做Now
变化是彻底的。现在 95% 的时间我不再亲手写代码,日常重心放在工程架构、模块设计和边界把控上:需求怎么拆、上下文怎么给、结果怎么验收。The change was total. Today I don't write code by hand 95% of the time. My days go into architecture, module design and boundaries: how to split the requirement, what context to give, how to accept the result.
最近在关心的事What I'm focused on lately
- Agent 工程Agent engineering
- 企业工作流Enterprise workflow
- 上下文与评估Context and evaluation
- 开源运行时Open-source runtimes
走过的路The road so far
传统后端Backend
实习期As an intern
做传统后端开发,做过高并发系统,也系统学过 DDD。I built conventional backends, worked on a high-concurrency system and studied DDD properly.
Java · 分布式系统 · 可靠性Java · distributed systems · reliability
AI 辅助AI-assisted
过渡期In between
AI 先以工具的身份进到日常开发里:写 Prompt、接 RAG、用编程副驾补代码。AI came into daily work as a tool first: writing prompts, wiring up RAG, letting a coding copilot fill in code.
Prompt · RAG · 编程副驾Prompts · RAG · coding copilots
AI 原生AI-native
正式工作一年多后A year or so into my first job
编程语言变得不那么重要,前后端的分工也是;也不再需要花大量时间去追框架和工具的更新。Languages matter less, and so does the front-end/back-end split; I no longer spend much time chasing framework and tool updates.
上下文 · 运行时 · 评估 · 系统工程Context · runtime · evaluation · systems
这段经历让我确信一件事:真正沉淀下来的不是某门语言或某个框架的熟练度,而是可迁移的工程判断:怎么划模块、怎么定边界、怎么让系统可验证。What this taught me: what lasts isn't fluency in one language or framework but engineering judgment that transfers: where to draw modules, where to put boundaries, how to make a system verifiable.
工具会换,这些不会。The tools will change. These won't.
这个博客记录的就是这些判断。它们来自真实项目,也应该能直接用于下一个项目。This blog is where I write those judgments down. They come from real projects, and they should be usable on the next one.
一个任务是怎么跑完的How a task gets done
意图、上下文、计划、构建、验证,五步走完一个任务。点任意一步,它就停下来等你看。Intent, context, plan, build, verify: five steps through one task. Pick any step and it stops there for you.
把“做个智能审批”压成可验收目标Turn “build a smart approval flow” into goals you can check
先把业务结果、人工边界和失败条件写清楚。交给 Agent 的,是一组能被证伪的工程假设。Pin down the outcome, the human boundaries and the failure conditions first. The agent gets falsifiable hypotheses, not a wish.
- 营销审批 P50 从 11 小时降到 4 小时内Approval P50 from 11 h to under 4 h
- 高风险决策必须保留人工确认High-risk decisions keep a human sign-off
- 每次建议都能回放上下文与依据Every suggestion can be replayed with its context and reasons
当前证据Evidence so far3 条验收约束已锁定3 acceptance checks locked
brief.mdmarkdown
goal: 缩短营销审批周期goal: shorten the approval lead timeguardrail: 不覆盖人工结论guardrail: never override a human decisionsuccess: lead_time_p50: < 4h trace_coverage: 100%只给模型刚好够用的上下文Give the model just enough context
将领域规则、真实样本和模块边界装进可版本化的 context pack,避免把整座代码仓库倾倒进窗口。Pack domain rules, real samples and module boundaries into a versioned context pack instead of dumping the whole repo into the window.
- 抽取 12 条审批规则与 8 个边界案例Pull 12 approval rules and 8 edge cases
- 标注禁止修改的订单与权限模块Mark the order and permission modules off-limits
- 关联 ADR、接口契约和失败日志Link ADRs, API contracts and failure logs
当前证据Evidence so far上下文预算 18.6K / 32K tokensContext budget 18.6K / 32K tokens
context-pack.yamlyaml
include: - domain/approval-rules.md - api/review-contract.tsexamples: fixtures/rejected/*.jsondeny: [auth/**, order-core/**]拆成能独立验证、随时回滚的切片Split the work into slices you can verify alone and roll back anytime
每一步都从接口穿到领域逻辑再到测试,让集成风险早点冒出来。Each step cuts through interface, domain logic and tests, so integration risk surfaces early.
- 切片 01:只读建议,不写入业务状态Slice 01: read-only suggestions, no state writes
- 切片 02:人工确认后才生成审批动作Slice 02: approval actions only after a human confirms
- 切片 03:灰度开启低风险字段自动补全Slice 03: canary auto-fill for low-risk fields
当前证据Evidence so far5 个切片 · 2 个可以并行5 slices · 2 safe to run in parallel
execution.planplan
01 contract + fixture ready02 advisor service ready03 review panel queued04 audit trail queued05 canary metrics blocked: 03让 Agent 写实现,人守住模块边界The agent writes the code; the human holds the module boundaries
Agent 在明确接口内循环编码、运行测试并提交小步 diff;工程师只在架构偏航和证据不足时介入。Inside clear interfaces the agent loops: code, run tests, commit small diffs. The engineer steps in only when the design drifts or the evidence is thin.
- 新增 AdvisorPort,不反向依赖流程引擎Add AdvisorPort with no reverse dependency on the workflow engine
- 失败路径返回可解释的 reason codeFailure paths return an explainable reason code
- 单次变更控制在 220 行以内Each change stays under 220 lines
当前证据Evidence so far18 个测试通过 · diff +186 / −2418 tests passed · diff +186 / −24
agent-run.loglog
09:42 inspect ReviewService09:44 patch + AdvisorPort09:45 test 18 passed09:47 review boundary: clean09:48 commit feat/advisor-slice-01用运行证据收口,而不是“看起来能跑”Close it out with runtime evidence, not “it seems to run”
构建结果必须同时通过契约、回归、越权和业务指标检查;每条结论都能跳回产生它的测试或追踪记录。The build must pass contract, regression, privilege and business-metric checks; every conclusion links back to the test or trace that produced it.
- 契约与回归用例 46 / 46 通过Contract and regression: 46 / 46 pass
- 越权写入与提示注入均被拦截Privileged writes and prompt injection blocked
- 影子流量下 P95 延迟为 238 msP95 238 ms under shadow traffic
当前证据Evidence so far建议进入 5% 灰度Recommend a 5% canary
verification.reportreport
contract PASS 12/12regression PASS 34/34permission PASS 8/8prompt-attack PASS 16/16decision SHIP canary=5%第一步,共 5 步Step 1 of 5:意图: Intent
在别处Elsewhere
- 代码CodeGitHub · DavidShawa
- 订阅SubscribeRSS 订阅RSS feed
- 文章Writing最近写的文章都在这里Recent writing is all here