48 Hours of API Contract Drift: Field Notes from a Free Model on a Free Server
说明与用途
在免费服务器上运行的自动化 API 漂移检测器使用 cron、JSON 模式验证和 LLM 生成简明的更改摘要。通过规范化 diff,减少了误报并捕获了真实更改。
问题
Detect silent API contract changes without a persistent database or orchestration platform.
结果
The detector caught two real contract changes (author field flattening and timestamp format) while eliminating most false positives after normalizing diffs. It proved useful as a low‑cost triage tool but not a sole gatekeeper.
工作流
- Set up a free server with systemd timer to run every 15 minutes
- Fetch API response and JSON Schema
- Validate response against schema with jsonschema
- Generate normalized diff (added, removed, type‑changed)
- Prompt free LLM with diff and example timestamp
- Receive plain‑English summary and impact rating
- Post summary to Slack webhook
证据
The free server did what free servers do: it slept. My initial cron expression ran every 15 minutes, but the process was killed after two hours of inactivity.
Instead of feeding raw JSON snippets, I started passing a normalized diff—one line per field, with only three states: added, removed, or type-changed.
Twice in 48 hours the detector fired with a real signal. The first was a deprecated author object that became a flat list of strings.
The second was more subtle: the API started returning timestamps without timezone offsets.
- 记录日期: 2026-09-05T18:08:14.516Z