get_why
Uncover the reasoning behind code structure with decision records and commit evidence, before refactoring or deviating from established patterns.
Instructions
Why this code is shaped this way — decision records + evidence commits.
Call before refactors or pattern divergences. Query modes: a question
("why is auth using JWT?"), a file path (governing decisions + origin
story + alignment score), a question anchored to targets, or no query
(decision health dashboard). Falls back to git archaeology when no
decisions exist for a path — never empty. Evidence-bearing rows carry an
explicit ``provenance`` and self-contained ``evidence_refs``; matching ids
mean shared evidence, not independent corroboration. Every decision row
carries ``authority``: ``accepted`` means somebody signed it, ``candidate``
means nobody has yet. ``answer_basis`` names the strongest lane the response
rests on (decision, episode, rationale, archaeology, documentation,
candidate); only ``decision`` is a ruling, and ``candidate`` is the weakest
-- it means nothing cleared that bar.
Args:
query: question, file/module path, or omit for the dashboard.
targets: optional file paths to anchor the search, or to ask about on
their own when there is no query.
repo: usually omitted.
id: decision or ``ev_...`` evidence id emitted by this or another tool.
reference: structured evidence reference. Its id and repository are
accepted together without caller translation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| repo | No | ||
| query | No | ||
| targets | No | ||
| reference | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |