feat(features): per-feature freshness spec — JIT vs batched (#61)

Each ml/features/*.py now declares freshness, source, and fallback per
feature. ProfileFeature gains ttl_sec (mirrored from registry.ts),
freshness="batched", source, and fallback. context.py adds
ContextFeatureSpec + CONTEXT_FEATURES for the three JIT features
(hour_of_day, day_of_week, tasks). CI test parses ttlSec from registry.ts
to catch drift. ml/README updated with split JIT/batched feature contract.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-25 17:02:55 +00:00
parent bd3ea1b8b1
commit 45416000f9
6 changed files with 218 additions and 21 deletions

View File

@@ -1,3 +1,8 @@
from .context import build_context, PromptContext, TaskSignal
from .context import build_context, PromptContext, TaskSignal, ContextFeatureSpec, CONTEXT_FEATURES
from .profile_schema import ProfileFeature, PROFILE_FEATURES, feature_names
__all__ = ["build_context", "PromptContext", "TaskSignal"]
__all__ = [
"build_context", "PromptContext", "TaskSignal",
"ContextFeatureSpec", "CONTEXT_FEATURES",
"ProfileFeature", "PROFILE_FEATURES", "feature_names",
]