Memory scanner lost its pattern-table tests when internal/memory was deleted (slice 5) #1511
Notifications
Due Date
No due date set.
Depends on
Reference: sam/archie#1511
Reference in new issue
Block a user
Memory unification slice 5 (#889) deleted internal/memory, and the DefaultScanner pattern-table tests went with it.
BEFORE: internal/memory/manager_test.go held TestDefaultScanner_ScanContent_{Clean,PromptInjection,SensitiveData,FirstMatchWins} and TestThreatResult_ZeroValue -- a table over the prompt-injection patterns, a table over the sensitive-data patterns, the first-match-wins precedence rule, and the zero value.
NOW: internal/domain/memory/ has contract.go, contract_test.go, registrar.go, registry.go, registry_test.go, scanner.go -- no scanner_test.go. The only remaining scanner coverage is TestBuiltinEngineScanWarnsWithoutRefusingTheWrite (internal/infrastructure/memory/builtin_engine_test.go), which asserts the two LEVELS through the engine (block refused loudly, warn stored) but not the pattern table itself. So most individual injection patterns and warn-level patterns are now unasserted: a regex edit that silently stops matching would pass the suite.
FIX: port the pattern tables into internal/domain/memory/scanner_test.go, asserting each pattern matches and the level/ordering holds. The scanner is now the family's write-time choke point (applied in Create and Update), so its patterns deserve their own tests in their own home.
CONTEXT: finding 7 of the adversarial review of the superseded local slice-2 branch. Slice 2 as merged also dropped the legacy builtin/provider.go from the relocated store package, resolving that review's layering concern.
Close reason
Closed on GitHub; syncing bead state
Imported from beads
archie-core-pf1g· GitHub #946 · type task · priority P3 · created 2026-09-19 · closed 2026-09-26