AI/Tasks/MemoryUpgrades/Memory_Phase07_LearningAccuracy.txt

Improve learning accuracy in the memory subsystem.
Apply changes ONLY within the memory subsystem and its tests.
 
Concrete scope:
- src/TechToolbox.Agent/Memory/MemoryLearner.cs
- src/TechToolbox.Agent/Memory/MemoryStore.cs
- src/TechToolbox.Agent/Memory/MemoryModels.cs
- src/TechToolbox.Agent/Tests/MemoryLearnerTests.cs (plus additional memory tests if needed)
 
Requirements:
- Distinguish durable user preferences from one-time task instructions.
- Replace broad regex-only inference with structured evidence metadata where possible.
- Require stronger evidence thresholds for permanent factual memory entries.
- Persist source category and confidence reason/rationale for learned items.
- Add adversarial tests: quoted text, negation, hypotheticals, examples/counterexamples.
- Do not modify unrelated subsystems.
 
Acceptance criteria:
- One-off instructions are not promoted to durable preferences by default.
- Learned-item provenance and confidence reason are queryable in model state.
- Adversarial parsing tests pass and prevent common false positives.
 
Validation:
- dotnet build src/TechToolbox.Agent/TechToolbox.Agent.csproj -c Release
- dotnet test src/TechToolbox.Agent/Tests/TechToolbox.Agent.Tests.csproj -c Release --filter "MemoryLearner|Memory|Preference"
 
Output results in markdown using this structure:
1) Summary
2) Files changed
3) Learning classification rules
4) Evidence/provenance model
5) Tests added/updated
6) Validation results