feat(memory): memory audit fixes — 4 missing items

This commit is contained in:
matevip 2026-04-21 15:28:26 +08:00
parent 6ae221b38d
commit 0351cc369e
4 changed files with 30 additions and 2 deletions

View File

@ -138,5 +138,8 @@ public class MemoryProperties {
/** Trust score half-life in days for time decay */
private int trustHalfLifeDays = 60;
/** Enable UI Forget button on facts (Phase 3) */
private boolean forgetEnabled = false;
}
}

View File

@ -64,8 +64,8 @@ public class FactController {
public R<Void> forgetFact(@PathVariable Long agentId,
@PathVariable Long factId,
Authentication auth) {
if (!properties.getFact().isProjectionEnabled()) {
return R.fail("Fact projection is disabled");
if (!properties.getFact().isForgetEnabled()) {
return R.fail(410, "Forget is disabled");
}
FactEntity fact = factMapper.selectById(factId);

View File

@ -218,3 +218,4 @@ mate:
llm-extraction-enabled: false
contradiction-check-enabled: false
trust-half-life-days: 60
forget-enabled: false

View File

@ -0,0 +1,24 @@
You are checking for contradictions between facts about the same entity.
For each pair below, determine if they genuinely contradict each other.
A contradiction means the two facts CANNOT both be true at the same time.
Pairs to check:
{pairs}
For each pair, respond in JSON array format:
[
{
"factA": <id>,
"factB": <id>,
"isContradiction": true|false,
"reason": "brief explanation"
}
]
Rules:
- Temporal differences are NOT contradictions (e.g. "uses Oracle" and "migrating to PostgreSQL" can coexist)
- Different scopes are NOT contradictions (e.g. "dev uses H2" and "prod uses MySQL")
- Only flag genuine logical conflicts where both cannot be simultaneously true
- Maximum 5 pairs per batch
- Output ONLY the JSON array, no explanation outside it