Show HN: Lever – replace agent token transport with deterministic hooks

Present_Flow1 pts0 comments

GitHub - Clear-Sights/Lever · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

Clear-Sights

Lever

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>6 Commits<br>6 Commits

.claude-plugin

.claude-plugin

.github/workflows

.github/workflows

commands

commands

hooks

hooks

lever

lever

tests

tests

.gitignore

.gitignore

BEDROCK.md

BEDROCK.md

LAW.md

LAW.md

LICENSE

LICENSE

NOTICE

NOTICE

README.md

README.md

pyproject.toml

pyproject.toml

View all files

Repository files navigation

Lever

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

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

Read LAW.md (the admission test any move must pass) and BEDROCK.md<br>(the settled primitive layer: 5 stations, 20 flow cells — complete by construction, every cell<br>SERVED, PARTIAL-with-named-machinery, or VOID-with-reason; silence is not a state).

What's here

Piece<br>What it is

lever/contract.py<br>the bound: Claude Code's documented hook schema as data, plus the three envelope types (rewrite dict / Deny / Block / advisory str)

lever/dispatch.py<br>the pivot: one stdin→stdout hook entrypoint; (event, tool) table lookup; picks the envelope by return type, never by content

lever/moves.py<br>the arms: every move is one composition m = α∘φ∘π — total projections, exact guards, typed envelope actions; 17 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

lever/store.py<br>the substrate: content-addressed artifact store — put/get/materialize/slice + an append-only firing ledger; identical bytes coincide, so N concurrent writers need zero coordination

lever/cells.py<br>the punchcard: BEDROCK's 20-cell coverage as data; the move rows are derived from each move's own flow declaration, reconciled against the doc AND against importable reality by tests — coverage drift is a red test, not a discovery

tests/test_laws.py<br>the universal laws, one parametrized test each over ALL moves: guard totality, rewrite idempotence (m∘m = ⊥), store monotonicity (CALM: monotone ⇒ coordination-free)

lever/facts.py<br>verified-fact reader (Makoto's hash-verified chain, or the session transcript) feeding the injection moves

tools/mine_corpus.py<br>corpus probe: re-derives what actually fires in your environment

Install (plugin)

Enable the plugin — that's the whole install. .claude-plugin/plugin.json +<br>hooks/hooks.json auto-wire dispatch on enable; enabling is the sign-off.

For development:

pip install -e ".[test]"<br>pytest -q # the public smoke test: catalog certifies, dispatch rewrites and denies<br># on the real wire, store round-trips, status runtime exits clean.<br># (The full 487-test falsifiability suite lives in the dev repo.)<br>python -m lever # the status trace: wiring, 20-cell coverage, store stats; nonzero on drift

Every threshold is an env-overridable operand (LEVER_GREP_HEAD_LIMIT, LEVER_TRUNCATE_THRESHOLD,<br>LEVER_TRUNCATE_KEEP, LEVER_READ_LARGE_BYTES, LEVER_READ_DEFAULT_LIMIT) — read once at<br>import, which in production means per hook firing, since each firing is...

lever deterministic plugin test store hooks

Related Articles