You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A new vis package (enchanter-hooks) shipping 11 deterministic, fail-open, quiet hooks that
enforce the conduct substrate at lifecycle events in-context conduct can't self-time.
Distributed via the vis marketplace (/plugin install enchanter-hooks@vis) — hooks activate
natively, no settings.json editing.
Hooks (event -> F-code):
compact-checkpoint SessionStart(compact) F03
secret-scan PreToolUse(Write|Edit) secret-exfil
config-self-edit-guard PreToolUse(Write|Edit) self-modification
substrate-engine-write-guard PreToolUse(Write|Edit) F24
artifact-authorship-guard PreToolUse(Write|Edit) authorship
append-only-log-edit-guard PreToolUse(Edit) F14
reversibility-guard PreToolUse(Bash) F26
debug-hygiene PostToolUse(Write|Edit) code-hygiene
post-write-validate PostToolUse(Write|Edit) F02/F14
stale-pathref-guard PostToolUse(Write|Edit) F02/F27
machine-path-leak-guard PostToolUse(Write|Edit) F02
Each clears a 5-part smart-test (deterministic, does-what-conduct-can't, advisory/fail-open,
non-redundant, quiet) and is verified incl. false-positive + fail-open audits. Built from an
open-web hook survey + a per-package mining sweep of the vis conduct substrate.
Also: register in marketplace.json (8 plugins), list in README, and add .gitattributes
forcing LF on *.sh so marketplace-cloned hooks don't break on Windows CRLF checkout.
Copy file name to clipboardExpand all lines: README.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ The behavioral substrate for building durable AI agents — conduct, engines, ta
29
29
30
30
**In plain English:** Most agent stacks ship with prompts, tools, and hopes. The thing that actually keeps an agent from refactoring code you didn't ask it to touch, or pushing to main after you said not to, isn't another tool — it's a behavior rule that survives the long context. vis is the dependency-free pile of those rules, plus the math, taxonomy, and host recipes around them.
31
31
32
-
**Technically:** 37 conduct modules across 7 packages (`core` / `skills` / `orchestration` / `safety` / `web` / `memory` / `cost`). 12 algorithmic engines with paper-backed derivations (Aho-Corasick pattern detection, Shannon entropy, Beta-Bernoulli trust scoring, Markov drift, Hunt-Szymanski LCS, Zhang-Shasha tree-edit, Tarjan SCC, Wald SPRT, Jaccard-cosine boundary segmentation, contextual LLM bandit, agentproof DFA, sycophancy calibration). 21 named failure codes (F01–F21) with testable counters, mapped to a 5-axis hybrid taxonomy (memory / reflection / planning / action / system) and 21 incident-response runbooks. 9 adoption recipes (Claude Code, OpenAI Agents SDK, Cursor, LangChain, Pydantic-AI, BAML, raw system-prompt, eval-harnesses, stupid-agent-review). Zero runtime dependencies — pure prose + math, loadable into any system that accepts text instructions.
32
+
**Technically:** 37 conduct modules across 7 conduct packages (`core` / `skills` / `orchestration` / `safety` / `web` / `memory` / `cost`), plus a `hooks` package shipping 6 runtime advisory hooks (the **enchanter-hooks** plugin, installable via the vis marketplace). 12 algorithmic engines with paper-backed derivations (Aho-Corasick pattern detection, Shannon entropy, Beta-Bernoulli trust scoring, Markov drift, Hunt-Szymanski LCS, Zhang-Shasha tree-edit, Tarjan SCC, Wald SPRT, Jaccard-cosine boundary segmentation, contextual LLM bandit, agentproof DFA, sycophancy calibration). 21 named failure codes (F01–F21) with testable counters, mapped to a 5-axis hybrid taxonomy (memory / reflection / planning / action / system) and 21 incident-response runbooks. 9 adoption recipes (Claude Code, OpenAI Agents SDK, Cursor, LangChain, Pydantic-AI, BAML, raw system-prompt, eval-harnesses, stupid-agent-review). Zero runtime dependencies — pure prose + math, loadable into any system that accepts text instructions.
For runtime enforcement (not just description), wire hooks per [`packages/skills/recipes/claude-code.md`](packages/skills/recipes/claude-code.md) § Enforcement wiring. The framework now includes copy-paste shell skeletons in [`packages/core/conduct/hooks.md`](packages/core/conduct/hooks.md) § Starter patterns — PreToolUse deny, PostToolUse inject, Stop notify.
221
+
For runtime enforcement (not just description), wire hooks per [`packages/skills/recipes/claude-code.md`](packages/skills/recipes/claude-code.md) § Enforcement wiring. The framework now includes copy-paste shell skeletons in [`packages/core/conduct/hooks.md`](packages/core/conduct/hooks.md) § Starter patterns — PreToolUse deny, PostToolUse inject, Stop notify. Or install them ready-made — `/plugin marketplace add enchanter-ai/vis` then `/plugin install enchanter-hooks@vis` — the **enchanter-hooks** plugin ships 6 advisory, fail-open hooks (post-compaction checkpoint, secret scan, config self-edit guard, reversibility guard, debug-hygiene, syntax validation) that activate without editing `settings.json`.
vis-governed **advisory** Claude Code hooks — deterministic, fail-open enforcement of the
4
+
conduct substrate at lifecycle events that in-context conduct **cannot self-time**.
5
+
6
+
Distributed the native way: `enchanter-hooks` is a Claude Code plugin in the `vis` marketplace.
7
+
Installing it activates the hooks automatically — no `settings.json` editing.
8
+
9
+
```
10
+
/plugin marketplace add enchanter-ai/vis
11
+
/plugin install enchanter-hooks@vis
12
+
```
13
+
14
+
## Design contract
15
+
16
+
Every hook here obeys five rules (the "smart-test" — a hook that fails any is rejected, not shipped):
17
+
18
+
1.**Deterministic trigger** — fires on an unambiguous event (tool call / lifecycle), never fuzzy intent.
19
+
2.**Does what conduct can't** — earns its place by acting where in-context conduct structurally can't, or reliably misses.
20
+
3.**Advisory / fail-open** — injects or warns, **never blocks**; every script exits 0 (and on a malformed payload, does nothing).
21
+
4.**Not redundant** — doesn't re-implement Claude Code's built-in permission gating (or, where it complements it, adds a stated delta).
22
+
5.**Quiet** — emits *nothing* unless it has something to say, so it never becomes ignored wallpaper.
23
+
24
+
## Hooks (v0.6 — 11)
25
+
26
+
| Hook | Event | F-code | What it does |
27
+
|---|---|---|---|
28
+
|`compact-checkpoint`|`SessionStart(compact)`| F03 | Re-injects a goal/state/invariants checkpoint right after a compaction (the one moment the model can't self-time). |
29
+
|`secret-scan`|`PreToolUse(Write\|Edit)`| secret-exfil | Scans content about to be written for high-signal secret patterns; warns. |
30
+
|`config-self-edit-guard`|`PreToolUse(Write\|Edit)`| self-modification | Warns on edits to the agent's own startup/hook/plugin config (`.claude/settings.json`, `hooks.json`, `.claude-plugin/`, `.mcp.json`). |
31
+
|`substrate-engine-write-guard`|`PreToolUse(Write\|Edit)`| F24 | Warns on hand-writes to inference-engine state (`catalog.json`/`artifacts.jsonl`/briefings/`.lock`) — must go through the engine. |
32
+
|`artifact-authorship-guard`|`PreToolUse(Write\|Edit)`| authorship | Warns when a public artifact (LICENSE/`.cff`/README/`.bib`) has author lines that don't credit "Enchanter Labs". Generic — no hardcoded names. |
33
+
|`append-only-log-edit-guard`|`PreToolUse(Edit\|MultiEdit)`| F14 | Warns on an in-place Edit of an append-only ledger (`.jsonl`/`.ndjson`) — append a row instead. |
|`post-write-validate`|`PostToolUse(Write\|Edit)`| F02/F14 | Fast-parses the written file (`.py`/`.json`/`.sh`/`.toml`) and warns on a syntax error, same turn. |
37
+
|`stale-pathref-guard`|`PostToolUse(Write\|Edit)`| F02/F27 | After writing a `.md`, checks its `@-imports` / local links actually resolve — the silent CLAUDE.md breakage. |
38
+
|`machine-path-leak-guard`|`PostToolUse(Write\|Edit)`| F02 | Warns when a git-tracked file gains machine-absolute paths (`C:\git`, `/Users/<n>/`) — use repo-relative form. |
39
+
40
+
Built in two passes: the first 6 from an open-web survey of agent-hook patterns; the last 5 from a
41
+
per-package mining sweep of the vis conduct substrate (each candidate gate-tested, deduped, and
42
+
verified against live repo evidence — e.g. `stale-pathref` against real `@-imports`, `authorship`
43
+
against a live `CITATION.cff` slip).
44
+
45
+
## Deferred (considered, did not clear the bar — or need a convention first)
46
+
47
+
-`claude-format-to-nonclaude-target`, `scratch-in-prompts-folder-guard` — wixie-`prompts/`-specific, not general vis; belong in a wixie-local hook set.
48
+
-`mcp-manifest-gate` — would warn on *every* MCP call until an `mcp-manifests/*.fingerprint.json` convention exists → wallpaper today. Revisit when that convention lands.
49
+
-`finish-checklist` (Stop), `substrate-injection` / `build-premise` (UserPromptSubmit) — fire every turn or rely on fuzzy intent. `build-premise` is superseded by the F29 *conduct* gate in `doubt-engine.md`.
50
+
-`backup-before-compact` — low value (transcripts are usually recoverable) + project-side file writes.
51
+
- egress-fence, write-scope-audit, subagent-spawn/budget counters, `learnings.md`/`SKILL.md` schema lints — failed "quiet" in practice, or cited contract files that don't exist in this codebase.
52
+
53
+
## Notes
54
+
55
+
- Scripts are **self-contained** (no references outside the plugin root) so they survive the
56
+
plugin cache (`~/.claude/plugins/cache/`). Require `jq` + `bash`; `python3`/`python` for the
57
+
syntax validators (fail-open if absent).
58
+
-`config-self-edit-guard`, `reversibility-guard`, and `substrate-engine-write-guard` are advisory
59
+
**complements** to permission gating, not replacements — the delta is the self-config/substrate
60
+
category and the reversibility framing.
61
+
- The `vis-drift` SessionStart hook is **not** shipped here — it is project-local (reads the
62
+
consuming repo's `.vis-lock` against a sibling `../vis` checkout), which is not plugin-portable.
"description": "enchanter-hooks — vis advisory Claude Code hooks. Deterministic triggers, fail-open (every hook exits 0, never blocks), and quiet (each emits nothing unless it has something to say). Each maps to a vis F-code. Self-contained scripts (plugin-cache-safe) under scripts/, referenced via ${CLAUDE_PLUGIN_ROOT}.",
0 commit comments