Memory scanner lost its pattern-table tests when internal/memory was deleted (slice 5) #1511

Closed
opened 2026-10-27 13:40:41 +00:00 by sam · 0 comments
Owner

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

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_
sam added the lowtask labels 2026-10-27 13:40:41 +00:00
sam self-assigned this 2026-10-27 13:40:41 +00:00
sam closed this issue 2026-10-27 13:40:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#1511