# encapsulation_advice

URL: /kida/api/analysis/encapsulation_advice/
Section: analysis
Description: Conservative inverse advice for exact pass-through components.

This module analyzes an explicitly owned set of parsed templates as one call
graph. It emits flattening advice only when a definition has one same-owner
caller and its complete body preserves an identical downstream component
interface without adding markup, behavior, context, or policy.

---

> For a complete page index, fetch /kida/llms.txt.

Open LLM text
(/kida/api/analysis/encapsulation_advice/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fanalysis%2Fencapsulation_advice%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fanalysis%2Fencapsulation_advice%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fanalysis%2Fencapsulation_advice%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fanalysis%2Fencapsulation_advice%2Findex.txt)

Module

#
`analysis.encapsulation_advice`

Conservative inverse advice for exact pass-through components.

This module analyzes an explicitly owned set of parsed templates as one call
graph. It emits flattening advice only when a definition has one same-owner
caller and its complete body preserves an identical downstream component
interface without adding markup, behavior, context, or policy.

3Classes1Function

## Classes

`_OwnedTemplate`

5

▼

#### Attributes

Name
Type
Description

`owner`

`str`

—

`name`

`str`

—

`source_path`

`str`

—

`ast`

`Template`

—

`profile_spans`

`dict[tuple[str, int, int], SourcePosition]`

—

`_Definition`

5

▼

#### Attributes

Name
Type
Description

`key`

`_ComponentKey`

—

`owner`

`str`

—

`source_path`

`str`

—

`node`

`Def`

—

`span`

`SourceSpan`

—

`_CallSite`

3

▼

#### Attributes

Name
Type
Description

`owner`

`str`

—

`template`

`str`

—

`span`

`SourceSpan`

—

## Functions

`_shape`

1

`object`

▼

Return a location-neutral immutable shape for interface defaults.

`def _shape(value: Any) -> object`

##### Parameters

Name
Type
Description

`value`
`Any`

##### Returns

`object`
