Detent 是一个严格被动的、确定性的编程智能体杠杆层,强制所有读取、写入、检索和呈现操作都通过确定性机制执行,仅将推理留给大语言模型。

Stars

16

7 天增长

暂无数据

Fork 数

0

开放 Issue

0

开源协议

Apache-2.0

最近更新

2026-07-19

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它直接解决了智能体行为随机化的核心问题,通过使绝大多数操作变得可确定、可验证,并减少了模型输出和隐藏的大模型中介抓取次数(已实测)。

适合谁使用

  • 构建 AI 编程智能体的开发者
  • 希望工具调用更可预测的 Claude Code 高级用户
  • 研究智能体可靠性和确定性的学者
  • 评估 LLM 工作流中确定性基础设施的工程师

典型使用场景

  • 防止大语言模型重新发出磁盘上已有的字节(使用内容寻址指针)
  • 拒绝大语言模型中介的网页抓取并强制使用确定性替代方案
  • 通过仅追加的日志记录每个确定性操作的硬审计轨迹
  • 通过事件和磁盘状态的纯函数实现可复现的智能体行为

项目优势

  • 每次钩子调用约 60 ms 的实测调度开销
  • 29 个动作分布在三个层级,20 个单元覆盖拓扑,以及普适定律测试(全称性、幂等性、单调性)
  • 内容寻址存储消除了并发写入者之间的协调需求
  • 实际会话中已证实:70,663 个字符的模型输出被指针取代,30 次大语言模型中介抓取被拒绝

使用前须知

  • 目前仅支持 Claude Code 的钩子模式
  • 编辑指针扩展需要变通方案,因为 Claude Code 在 PreToolUse 重写之前会验证 Edit 输入
  • 不替代大语言模型的推理——只处理已决定动作的确定性执行

README 快速开始

Detent

One question: of everything an agent does, how much can be made reliably deterministic?

Detent is a strictly passive, deterministic leverage layer for coding agents. The LLM's irreducible remainder is reasoning — deciding, and emitting specs. Everything else — every read, write, retrieval, verification, and presentation of fact — runs through deterministic machinery instead of the default token transport: pure functions of the event and disk state, no model call anywhere, ever. Generation is stochastic exactly once; the moment output exists it is a content-addressed artifact, and every later use is a deterministic copy, never a re-emission. Denial is never the point — it is only the redirect at the boundary, used exactly where the default path is provably identical to a free deterministic one.

Read LAW.md (the admission test any move must pass). The primitive layer itself — 5 stations, 20 flow cells, complete by construction, every cell SERVED, PARTIAL-with-named-machinery, or VOID-with-reason; silence is not a state — ships as code: detent/cells.py, the punchcard.

What's here

PieceWhat it is
detent/contract.pythe bound: Claude Code's documented hook schema as data, plus the three envelope types (rewrite dict / Deny / Block / advisory str)
detent/dispatch.pythe pivot: one stdin→stdout hook entrypoint; (event, tool) table lookup; picks the envelope by return type, never by content
detent/moves.pythe arms: every move is one composition m = α∘φ∘π — total projections, exact guards, typed envelope actions; 29 moves across three tiers, enforcement (pure), capture (write only to the store, atomically), and display (render-by-address at the screen boundary), each declaring its own station flows; coverage is a quotient, not an enumeration — wildcard rows bound EVERY tool's oversized output and gate the whole →WORLD class, including tools that don't exist yet
detent/store.pythe substrate: content-addressed artifact store — put/get/materialize/slice + an append-only firing ledger; identical bytes coincide, so N concurrent writers need zero coordination
detent/cells.pythe punchcard: the 20-cell coverage topology as data; the move rows are derived from each move's own flow declaration, reconciled against importable reality by tests — coverage drift is a red

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

lopopolo
精选
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI 与机器学习AI 智能体
2,390
slvDev
精选
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI 与机器学习大语言模型
1,960
littledivy
精选
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI 与机器学习
1,482