Skip to main content

query_decisions

Function query_decisions 

Source
pub fn query_decisions(
    git: &dyn GitOps,
    query: &DecisionsQuery,
) -> Result<DecisionsOutput, GitError>
Expand description

Collect decisions and rejected alternatives from annotations.

In v3, decisions come from insight wisdom entries whose content matches the “{what}: {why}” pattern (from v2 decision migration), and rejected alternatives come from dead_end wisdom entries whose content matches the “{approach}: {reason}” pattern.

  1. Determine which commits to examine
  2. For each commit, parse annotation via parse_annotation
  3. Collect insight entries as decisions, dead_end entries as rejected alternatives
  4. When a file is given, filter by wisdom entry file scope
  5. Deduplicate by content, keeping the most recent