feat: enable reinforcement on live capture

The Stop hook now sends reinforce=true so the token-overlap matcher
runs on every captured interaction. Memory confidence will accumulate
signal from organic Claude Code use.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-11 10:58:56 -04:00
parent 0b1742770a
commit c5bad996a7
2 changed files with 3 additions and 3 deletions

View File

@@ -3,7 +3,7 @@
Reads the Stop hook JSON from stdin, extracts the last user prompt Reads the Stop hook JSON from stdin, extracts the last user prompt
from the transcript JSONL, and POSTs to the AtoCore /interactions from the transcript JSONL, and POSTs to the AtoCore /interactions
endpoint in conservative mode (reinforce=false, no extraction). endpoint with reinforcement enabled (no extraction).
Fail-open: always exits 0, logs errors to stderr only. Fail-open: always exits 0, logs errors to stderr only.
@@ -81,7 +81,7 @@ def _capture() -> None:
"client": "claude-code", "client": "claude-code",
"session_id": session_id, "session_id": session_id,
"project": project, "project": project,
"reinforce": False, "reinforce": True,
} }
body = json.dumps(payload, ensure_ascii=True).encode("utf-8") body = json.dumps(payload, ensure_ascii=True).encode("utf-8")

View File

@@ -183,7 +183,7 @@ class TestCapture:
assert body["prompt"] == "Please explain how the backup system works in detail" assert body["prompt"] == "Please explain how the backup system works in detail"
assert body["client"] == "claude-code" assert body["client"] == "claude-code"
assert body["session_id"] == "test-session-123" assert body["session_id"] == "test-session-123"
assert body["reinforce"] is False assert body["reinforce"] is True
@mock.patch("capture_stop.urllib.request.urlopen") @mock.patch("capture_stop.urllib.request.urlopen")
def test_skips_when_disabled(self, mock_urlopen, tmp_path): def test_skips_when_disabled(self, mock_urlopen, tmp_path):