Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/lawofall/agentcore/protocol-conformancegit clone --depth 1 https://github.com/Lawofall/AgentCoreWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01115 |
| Opus 5 | $0.00000 | $0.00558 |
| Sonnet 5 | $0.00000 | $0.00223 |
| Haiku 4.5 | $0.00000 | $0.00112 |
Grade A, and why
protocol-conformance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
协议漂移巡检
生产 fold 只留桌面(fold(events[]) → ProjectedTurn)。手机 fold 已退役。行为对齐靠这套巡检让漂移「响」、可被 AI 自动发现。背景见 前端技术与架构.md §十 SSE 与协议一致性。
现状:只跑桌面。conformanceFold 适配器复用桌面真实的 projectExecution(团队图),单聊 process 时间线复用 @/lib/processTimeline。
三支柱
- 后端权威向量 + golden oracle——
packages/protocol-conformance存:后端导出的真实事件序列(向量)+ 后端投影的期望ProjectedTurn(golden)。桌面 fold 跑同向量、断言== golden。后端是输入与期望的单一源。 - 共享类型 + 穷尽——桌面 import 同一套事件类型;fold 用判别联合
switch+assertNever兜底。后端加事件类型 → 重生成 → 编译失败直到处理。 - AI 可操作——
pnpm conformance= 桌面pnpm -C apps/desktop run conformance(vitest;根pnpm -r run conformance只跑仍声明该脚本的包)。失败打ProjectedTurndiff(golden vs actual)指到分叉字段。发布前本地必跑pnpm conformance/release:gate。
何时必跑 / 必更新
- 动桌面协议 fold → 必跑
pnpm conformance。 - 给已有事件 payload 加可选字段 → 字段消费棘轮必须绿(叶名在 desktop/admin/fold-kit 生产代码有读点,或基线分组豁免)。独立于事件名孤儿闸。判据是叶名零命中,不是 AST
(事件,字段);解构 /idField/ 整包再读 / 重命名拷贝都算读。禁止靠删契约字段过闸。uv run python scripts/check_event_field_consumers.py(release:gatebackend)。 - 新增向量 → 后端哨兵
apps/server/tests/test_conformance_projection*.py有覆盖棘轮(未写手验断言的向量数只降不升),加向量会让它红:高危面(失败/中止/挂起态、无正文的空泡脸、生命周期不留幽灵卡)补一条手工推导的断言(禁抄 golden——抄了就和 oracle 同错),其余面显式抬基线数字。 - 后端改事件契约 / 投影 → 重导向量 + golden(单一源),桌面对齐到红转绿。
- 发现协议 bug → 先加一条复现向量(棘轮),再修。向量两来源:手写 builder(
agentcore/conformance/vectors/)或从真实回合录制裁切(agentcore/conformance/recording_cut.py,产物recorded_*前缀)→ 见前端技术与架构.md§十 SSE 与协议一致性。 - 手写向量字段值必须与生产实现逐字一致(group/channel 等分类字段尤甚),禁
null/占位敷衍。取证员向量若写group:null而生产发debate:investigators:*,布局会在全绿 CI 下击穿。新增 run 类向量时对照产出该 run 的后端代码抄真值。
ProjectedTurn(规范化裁判态)
平台无关、可序列化:{ messages, runs(树), status, pendingInteraction, cost }。桌面实现 fold → ProjectedTurn 测试快照(内部 store 形状可不同)。
边界
只巡检协议 / 状态 fold(高危、静默、只能测试抓);组件 / chrome 不进巡检(错了一眼看见)。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 38 lines · 0 tokens per session scan A ab36e9eea52f
protocol-conformance is a cursor rule published in the GitHub repository Lawofall/AgentCore (78 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,115 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
code-patterns
Python code style and recurring patterns (config, logging, errors, paths).
project-overview
Core project architecture, patterns, and conventions for the AI Documentation Generator.
cursorrules
You are an AI agent building the module: {{MODULENAME}} This module is part of the Mnemosyne Neural OS ecosystem by XPACEGEMS LLC.
backend-python
Python and FastAPI standards for the backend.
core-project-context
Canonical project context and ownership rules.
dashboard-typescript
React and TypeScript standards for the operator dashboard.