Skip to main content

read_active_task_scope

Function read_active_task_scope 

Source
pub fn read_active_task_scope(
    db_path_parent: Option<&Path>,
) -> Option<Vec<String>>
Expand description

Useful entries add a boost; Noisy / WrongLayer entries demote the symbol to negative infinity (effectively removed). Also:

  • t-002: Sibling propagation — when a symbol in a file is marked Noisy or WrongLayer, all other symbols from the same file are also suppressed for query families that overlap the noisy verdict.
  • t-003: Query-family matching — a stored verdict applies to the current query when they share at least one non-stopword token, not just exact substring match.
  • Recurring false positives — symbols with ≥2 noisy verdicts sharing a query token are suppressed for any query that overlaps those tokens.

Called at CLI/MCP call sites after find_candidates. Plan C t-006: read the active CTX task scope (file globs) and return it for bias scoring. Source preference: CTX_ACTIVE_TASK env var (JSON object), else .asd/cache/active-task.json relative to the db’s parent dir, else None. Schema: {"task_id": "...", "scope": ["src/foo/**", ...]} — only the scope array is consumed.

Returns None when no task state is found or the scope is empty. The caller treats a None return as “no bias to apply”.