context_resolve
Determine the entity for current work by ranking explicit signals over weak ones, returning a confidence score and indicating when to ask the user.
Instructions
Resolve which entity the current work belongs to, with a derived confidence. Deterministic — matches explicit signals (passed entity, named mention, active mission, files touched) before weak ones (lexical, single-active); never guesses from cwd. Returns entity_id + confidence + ask_user. Call this BEFORE focus_get/decision_check when the target entity is not already known, then pass the returned entity_id into them. Confidence >= 0.80: proceed silently. 0.50-0.79: proceed but say 'I think this is X'. < 0.50 (ask_user true): ask one short question.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_message | No | What the user said they want to do, verbatim. Strongest inferred signal. | |
| files_touched | No | Paths being worked on. Matched by exact path segment against entity id/aliases — assists only, never overrides an explicit mention. | |
| active_mission_id | No | Entity id of the active approved mission/task, if any. | |
| explicit_entity_id | No | Caller-asserted entity id. Authoritative (confidence 1.0) when it matches a known entity. |