Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "python3 -I \"$CLAUDE_PROJECT_DIR/tools/hooks/identity.py\" || exit 2",
"timeout": 60
}
]
}
],
"PostToolUse": [
{
"matcher": "Edit|Write|MultiEdit|NotebookEdit",
"hooks": [
{
"type": "command",
"command": "python3 -I \"$CLAUDE_PROJECT_DIR/tools/hooks/after_edit.py\" || exit 2",
"timeout": 120
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "python3 -I \"$CLAUDE_PROJECT_DIR/tools/hooks/before_stop.py\"",
"timeout": 600
}
]
}
]
}
}
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ make verify # every check and every test, half a minute; SIM_SE
python3 -m tools.mutants # breaks each Kernel rule in turn; a test must notice. A minute or two
```

Both must pass before a change is finished. Python 3.9 or later; there is nothing to install.
Both must pass before a change is finished. Python 3.9 or later; nothing to install. Hooks in `.claude/settings.json` run `make fast` after an edit and `make verify` before a session with unpushed work ends, and refuse commits and pushes not the Maintainer's.

## The rules that are never broken

Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
PY ?= python3

.PHONY: verify
.PHONY: verify fast
verify:
$(PY) -m tools.verify

fast:
$(PY) -m tools.verify --fast
2 changes: 1 addition & 1 deletion config/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ deterministic Lens is named for the check GitHub reports: `verify`, `secret-scan
only a dependency update may be judged without a model Lens),
`authority.json` for who owns each category of Finding, `rubric-pr-review.json` for what a review
must look at, `apps.json` for each GitHub App's permissions and the repos it is installed on, which the
Maintainer registers each App from.
Maintainer registers each App from, `hooks.json` for the Maintainer, whose name every commit and push here carries.

| Rule | Held by |
|---|---|
Expand Down
7 changes: 7 additions & 0 deletions config/hooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"maintainer": {
"login": "don-petry",
"name": "Don Petry",
"email": "36422719+don-petry@users.noreply.github.com"
}
}
6 changes: 6 additions & 0 deletions examples/invalid/hooks.maintainer-with-no-email.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"maintainer": {
"login": "don-petry",
"name": "Don Petry"
}
}
34 changes: 34 additions & 0 deletions schemas/hooks.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "What the session hooks are told: whose name a commit or a push in this repo carries.",
"type": "object",
"additionalProperties": false,
"required": [
"maintainer"
],
"properties": {
"maintainer": {
"type": "object",
"additionalProperties": false,
"required": [
"login",
"name",
"email"
],
"properties": {
"login": {
"type": "string",
"pattern": "^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$"
},
"name": {
"type": "string",
"minLength": 1
},
"email": {
"type": "string",
"pattern": "^[^@\\s<>]+@[^@\\s<>]+$"
}
}
}
}
}
3 changes: 2 additions & 1 deletion tests/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# tests/

`test_decide.py` holds one test for each boundary case of the Kernel. `test_tools.py` makes every
check fail. `test_simulator.py` runs the seeded simulation. `support.py` builds ordinary inputs.
check fail. `test_simulator.py` runs the seeded simulation. `test_hooks.py` feeds each session hook a
violation and a clean case. `support.py` builds ordinary inputs.
The page `docs/standards/tests.md` shows each of these by example.

| Rule | Held by |
Expand Down
Loading
Loading