Refinement Pipeline
Runs overnight to keep the graph accurate. Uses idle LLM capacity from your subscription.
Usage
npm run refine # all tasks
npm run refine -- --only staleness # single taskTasks
Staleness Detection (P0)
Compares each decision's commit_hash against current code (git HEAD). If the anchored function has changed significantly, the decision is marked stale. A follow-up LLM pass judges whether the decision still holds despite the code change.
Anchor Precision Upgrade (P0)
Fuzzy anchors from daytime extraction (e.g., "related to auth") are matched against actual code to pin down to function-level.
Keyword Normalization (P0)
Unifies synonyms across decisions: "authentication" / "auth" / "token verification" → unified standard term with aliases preserved. Also fills in missing keywords.
npm run connect # includes keyword normalizationDecision Edge Completion (P1)
Analyzes all decision nodes and infers missing relationship edges. Developers rarely say "this is because of that decision from three weeks ago" — but the LLM can infer it after the fact.
Gap Detection (P2)
Compares code complexity against decision coverage. Finds high-complexity functions with zero decisions and generates a to-do list for the next analysis pass.
Deduplication (P2)
Merges decisions extracted from different sessions that describe the same thing. Keeps the most complete version, combines keywords and anchors.
How Results Take Effect
All refinement results take effect automatically. The confidence field is updated internally (e.g., auto_generated → refined), but the consumer (your coding AI) treats all decisions equally regardless of source.