fix: complete B-03/B-08/B-09 and add OMBRE_*_MODEL env vars

- decay_engine: keep activation_count as float (B-03);
  refresh local meta after auto_resolve so resolved_factor
  applies in the same cycle (B-08)
- server.hold(): user-supplied valence/arousal now takes
  priority over analyze() output (B-09)
- utils.load_config: support OMBRE_DEHYDRATION_MODEL
  (with OMBRE_MODEL alias) and OMBRE_EMBEDDING_MODEL
- ENV_VARS.md: document new model env vars
- tests/conftest.py: align fixture with spec-correct weights
  (time_proximity=1.5, content_weight=1.0) and feel subdir layout
This commit is contained in:
P0luz
2026-04-21 19:05:08 +08:00
parent d2d4b89715
commit b318e557b0
5 changed files with 158 additions and 12 deletions

View File

@@ -112,7 +112,7 @@ class DecayEngine:
return 50.0
importance = max(1, min(10, int(metadata.get("importance", 5))))
activation_count = max(1, int(metadata.get("activation_count", 1)))
activation_count = max(1.0, float(metadata.get("activation_count", 1)))
# --- Days since last activation ---
last_active_str = metadata.get("last_active", metadata.get("created", ""))
@@ -215,6 +215,7 @@ class DecayEngine:
if imp <= 4 and days_since > 30:
try:
await self.bucket_mgr.update(bucket["id"], resolved=True)
meta["resolved"] = True # refresh local meta so resolved_factor applies this cycle
auto_resolved += 1
logger.info(
f"Auto-resolved / 自动结案: "