p2.5: log host=- for permit_restricted callers

Scrape, fetch, refused, fetch-failed, and internal lines redact the
host for callers in context.permit_restricted. final_url stays in the
response. Test captures slog records, not the journal.
This commit is contained in:
2026-09-23 11:40:45 -07:00
parent e36da19f57
commit 85113f9c0b
4 changed files with 165 additions and 3 deletions
+2
View File
@@ -149,6 +149,8 @@ CLI: `sift fetch <url> --question Q` (implies digest + context), `--mode clean|r
context calls/hits/failures; recover attempts/successes by route; token ratio histogram.
Logs: one INFO line per request with `caller host mode q_len raw_tokens returned_tokens
digest_ms fallback`. Never log page content, questions longer than 80 chars, or keys.
Callers in `context.permit_restricted` log `host=-` on scrape, fetch, refused, fetch-failed,
and internal lines (P2.5). `final_url` stays in the response body.
## 7. Tests