# Agent Admissibility Pack

Generated by `ggen lsp emit-pack`. This pack locks coding agents to your project's
canon: the LSP applies **live type pressure** while editing, and the hooks act as
an **admission gate** before edits/commits land.

```
TTL/SHACL project law
 → ggen manufactures this pack (LSP config + hooks + policies)
 → agent edits under LSP pressure (live diagnostics)
 → hooks run `ggen lsp check` and refuse the edit/commit on any ERROR
 → MCP/A2A execute only admitted motions
 → receipts prove consequence
```

**v30.1.1 law:** *coding agents may not edit law-surface files without a generated
LSP and generated hooks enforcing the same canon.*

## Layout

| Path | Purpose |
|------|---------|
| `lsp/lsp-config.json` | Law-surface globs + policy paths shared by the LSP and hooks |
| `hooks/<agent>/pre-edit.sh` | Refuse an edit to a law-surface file that violates canon |
| `hooks/<agent>/post-edit.sh` | Warn (non-blocking) after an edit |
| `hooks/<agent>/pre-commit.sh` | Refuse a commit whose staged law surfaces violate canon |
| `hooks/<agent>/refusal.sh` | Shared refusal formatter |
| `policies/*.shacl.ttl` | Default SHACL policies (public-vocab, no-private-namespace, receipt-required) |
| `receipts/` | Where consequence receipts accumulate |

## Hook contract

Each hook shells out to `ggen lsp check` and refuses on: any ERROR diagnostic,
private namespaces, unresolved references, SHACL violations, an unreceipted
generated artifact, or a stale symbol graph.

## Install (git)

```sh
ln -sf ../../.agent-admissibility/hooks/generic/pre-commit.sh .git/hooks/pre-commit
```

## Install (Claude Code)

Merge `hooks/claude-code/settings-snippet.json` into `.claude/settings.json`.

## Requirements

- `ggen` v26.5.21+ on `PATH` (provides `ggen lsp check`).
