Skip to content

API Reference parrot_tools.wiki.decisions

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.wiki.decisions

View source

Decision plane tools and toolkit (moved from parrot.knowledge.wiki.decisions — FEAT-540 M3).

Class DecisionToolkit

Query the codebase's architectural decisions: symbol lookup and cited why.

Tool prefix: "decision" — methods are exposed as decision_for_symbol and decision_why. Candidate generation is explicit opt-in via include_generation=True and still requires generation_enabled in the project config. Review is never exposed (spec §2, AC11).

Parameter Type Default Description
root Path | None None Wiki project root. Defaults to :func:find_project_root from the current working directory.
store BaseWikiStore | None None Pre-built retrieval plane. When omitted, one is built from config the same way wikitoolkit's CLI does.
config WikiProjectConfig | None None Effective project configuration. Defaults to :func:load_effective_config for root.
include_generation bool False Reserved for a future opt-in generation tool. This toolkit never exposes review — accepting a candidate is a maintainer CLI action only (spec §2, AC11).
**kwargs Any {} Forwarded to :class:AbstractToolkit.

Attributes:

Attribute Type Description
tool_prefix str

Method DecisionToolkit.for_symbol

Find the architectural decisions that apply to a symbol.

Returns two separate groups: documented (real ADRs, with their declared lifecycle status) and candidates (INFERRED hypotheses that no maintainer has accepted). Every hit carries its origin, status, freshness and at least one source citation.

for_symbol(symbol: str, include_history: bool = False, limit: int = 10) -> dict[str, Any]

Parameter Type Default Description
symbol str A sym:<rel>#<qualname> id, or an exact symbol name. An ambiguous name returns status='ambiguous' with the candidate ids rather than guessing.
include_history bool False Also return rejected, deprecated and superseded records.
limit int 10 Maximum hits across both groups.

Returns: dict[str, Any] — A DecisionDossier as a JSON-safe dict.

Raises:

  • DecisionError — With a stable ADR_* code.

Method DecisionToolkit.why

Answer a 'why is it built this way' question with cited decisions.

Documented decisions rank above inferred candidates and the two groups are never merged. Citations prove what the code does; a candidate's hypotheses are reasoning, not history.

why(question: str, include_history: bool = False, limit: int = 10) -> dict[str, Any]

Parameter Type Default Description
question str Natural language; it need not name a symbol.
include_history bool False Also return rejected/deprecated/superseded records.
limit int 10 Maximum hits across both groups.

Returns: dict[str, Any] — A DecisionDossier as a JSON-safe dict.

Raises:

  • DecisionError — With a stable ADR_* code.

Attribute ServiceFactory

Class WikiDecisionGenerateTool

Generate labeled candidate rationale for an undocumented symbol or file.

Registered ONLY when generation is enabled and a local writable project is available. It creates UNREVIEWED candidates — it cannot accept anything.

Parameter Type Default Description
service_factory ServiceFactory

Class WikiDecisionWhyTool

Answer "why is this built this way?" with cited decision excerpts.

Parameter Type Default Description
service_factory ServiceFactory

Class WikiDecisionsForSymbolTool

Find the architectural decisions that apply to a symbol, with citations. Returns documented ADRs and, separately, labeled inferred candidates.

Parameter Type Default Description
service_factory ServiceFactory

Class WikiSpecConsequencesTool

Evaluate a spec's declared decisions, or return its governing-decisions dossier.

Parameter Type Default Description
store BaseWikiStore
root Path
config WikiProjectConfig

Function create_decision_tools

Create namespace-aware read tools and explicitly enabled generation tools.

The two read tools are always returned. wiki_decision_generate is appended ONLY when config.decisions.generation_enabled is true AND a local writable root exists (spec §2 Module 6). No review tool is ever created (AC11).

create_decision_tools(store: BaseWikiStore, root: Path | None, config: WikiProjectConfig) -> list[AbstractTool]

Parameter Type Default Description
store BaseWikiStore
root Path | None
config WikiProjectConfig

Returns: list[AbstractTool]

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally