# roles

URL: /kida/api/analysis/roles/
Section: analysis
Description: Role classification for template blocks.

Heuristic classification based on block name and emitted landmarks.
Returns "unknown" when classification is ambiguous.

---

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

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

Share with AI

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

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

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

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

Module

#
`analysis.roles`

Role classification for template blocks.

Heuristic classification based on block name and emitted landmarks.
Returns "unknown" when classification is ambiguous.

1Function

## Functions

`classify_role`

2

`RoleType`

▼

Classify block role based on name and emitted landmarks.

This is a heuristic, …

`def classify_role(block_name: str, landmarks: frozenset[str]) -> RoleType`

Classify block role based on name and emitted landmarks.

This is a heuristic, not semantic truth. Returns "unknown" when
classification is ambiguous.

Priority:

- Landmarks (most reliable signal)

- Block name patterns (fallback)

##### Parameters

Name
Type
Description

`block_name`
`str`

Block identifier (e.g., "nav", "content", "sidebar")

`landmarks`
`frozenset[str]`

HTML5 landmarks emitted by this block

##### Returns

`RoleType`
