Problem
memory::policy::assess_memory_write and infer_metadata run on every auto-captured fact and explicit memory_store write. Even for benign household content (User likes hiking, User's name is Jared), they always allocate a full Unicode content.to_lowercase() view before the existing restricted/private/cautious early-outs (#497) can classify the entry.
Most auto-capture writes are allow-path household memories. Paying an unconditional content lowercase allocation on every write is wasted work on Jetson.
Proposed fix
Add ASCII case-insensitive trigger gates over the existing restricted, private-intent, and cautious marker sets (mirroring #608 for extract_facts). Defer content.to_lowercase() until at least one gate fires; use a kind-only metadata fast path for benign content.
Acceptance
- Byte-identical output on the existing
memory_policy_corpus_regression corpus plus mixed-case allow-path cases.
policy_bench allow-preference case should show lower per-call latency on Jetson.
- No behavior change on restricted, private, or cautious hits.
Problem
memory::policy::assess_memory_writeandinfer_metadatarun on every auto-captured fact and explicitmemory_storewrite. Even for benign household content (User likes hiking,User's name is Jared), they always allocate a full Unicodecontent.to_lowercase()view before the existing restricted/private/cautious early-outs (#497) can classify the entry.Most auto-capture writes are allow-path household memories. Paying an unconditional content lowercase allocation on every write is wasted work on Jetson.
Proposed fix
Add ASCII case-insensitive trigger gates over the existing restricted, private-intent, and cautious marker sets (mirroring #608 for
extract_facts). Defercontent.to_lowercase()until at least one gate fires; use a kind-only metadata fast path for benign content.Acceptance
memory_policy_corpus_regressioncorpus plus mixed-case allow-path cases.policy_benchallow-preference case should show lower per-call latency on Jetson.