eval: advisory instruction feedback from Claude Code sessions

`ajieval sessions` pairs each human prompt with what the assistant did
just before it, and asks Jev whether the prompt was a correction and which
repository rule (AGENTS.md, the aji-jev skill, commit memory) the corrected
behaviour broke. Excerpts are truncated and credential-like strings
redacted; answers stay in a local log, and each prompt is sent once.

`sessions report` proposes clarifying a rule only when corrections pointing
to it recur across sessions (thresholds in triage.json); it never edits
instructions. `sessions hook` is meant for a personal SessionEnd hook: it
returns at once and scans in the background, and does nothing without a
TypeSafe key, which may now also come from ~/.config/typesafe/api_key.
This commit is contained in:
dev committed 2026-10-07 22:37:24 +03:00
1 parent dde801c653
commit 65e7a0a97c
6 files changed
+352 -4

No files matched your search

+6
View File
@@ -28,6 +28,12 @@ Jev (TypeSafe) is a System One classifier. It answers typed questions (`choice`,
- `task_ambiguity`: run the task acceptance review (protocol §8).
- `model_capability`: nothing.
## Session feedback on instructions and skills
A personal SessionEnd hook (`.claude/settings.local.json`, never the shared settings) runs `python3 -m ajieval sessions hook` from `tools/eval`. In the background it pairs each human prompt with what the assistant did just before, redacts credential-like strings, truncates both, and asks Jev two questions: whether the prompt was a correction, and which rule in `sessions.RULES` the corrected behaviour broke. Answers stay in `~/.cache/aji-sessions/events.jsonl`. Without a TypeSafe key the hook does nothing.
`python3 -m ajieval sessions report` proposes clarifying a rule only when corrections pointing to it recur across sessions (thresholds in `triage.json`, `sessions`). Act on a proposal by sharpening the rule where it lives (`AGENTS.md`, this skill, or memory) and only after the owner agrees. The report never edits anything. Corrections no rule explains are listed as `unattributed`; recurring ones suggest a missing rule.
## Changing the questions
The option descriptions in `tools/eval/ajieval/jev.py` are the classifier's input. A change there changes `questions_hash`, and suggestions made under different hashes must not be mixed in `calibrate`. Keep the descriptions atomic and literal: Jev reads instructions at face value and handles multi-hop reasoning poorly.