# `orchestrator.pkg.scope`
<!-- generated by `orchestrator understand`; the PKG is source of truth, edits here are advisory -->

[← Episteme](../README.md) · [Architecture](../architecture.md)

**Source:** [`src/orchestrator/pkg/scope.py`](../../src/orchestrator/pkg/scope.py)

10 types · 9 functions · python

## Changing this safely

**Tested by** (1): `tests.pkg.test_scope`

**Most depended-upon here** — a change to these reaches the most code (call graph, ≤4 hops):

- [`_text`](../../src/orchestrator/pkg/scope.py#L134) — reaches **13** symbols · **no test path visible**
- [`_Open`](../../src/orchestrator/pkg/scope.py#L139) — reaches **4** symbols
- [`FileScopes`](../../src/orchestrator/pkg/scope.py#L94) — reaches **3** symbols
- [`Scope`](../../src/orchestrator/pkg/scope.py#L64) — reaches **3** symbols
- [`_declarator_name`](../../src/orchestrator/pkg/scope.py#L378) — reaches **2** symbols · **no test path visible**
- [`_named_fields`](../../src/orchestrator/pkg/scope.py#L204) — reaches **2** symbols · **no test path visible**
- [`_parser_for`](../../src/orchestrator/pkg/scope.py#L466) — reaches **2** symbols
- [`_ts_pattern_names`](../../src/orchestrator/pkg/scope.py#L223) — reaches **2** symbols · **no test path visible**

_8 of the symbols other code depends on here have no test path the graph can see — worth a second look before changing them. Absence of a path is not proof of absence of a test: calls through an attribute chain (`obj.method()`) are skipped rather than guessed at, so indirect coverage is invisible._

## Types

### `BareCall`

[`src/orchestrator/pkg/scope.py:82`](../../src/orchestrator/pkg/scope.py#L82)

- **Called by** (1): [`visit`](../../src/orchestrator/pkg/scope.py#L155)
- **Fields**: `line`, `name`

### `Binding`

[`src/orchestrator/pkg/scope.py:43`](../../src/orchestrator/pkg/scope.py#L43)

- **Called by** (1): [`visit`](../../src/orchestrator/pkg/scope.py#L155)
- **Fields**: `line`, `name`

### `FileScopes`

[`src/orchestrator/pkg/scope.py:94`](../../src/orchestrator/pkg/scope.py#L94)

- **Called by** (1): [`collect`](../../src/orchestrator/pkg/scope.py#L146)
- **Fields**: `calls`, `scopes`

### `Scope`

[`src/orchestrator/pkg/scope.py:64`](../../src/orchestrator/pkg/scope.py#L64)

- **Called by** (1): [`collect`](../../src/orchestrator/pkg/scope.py#L146)
- **Fields**: `bindings`, `end`, `local`, `start`

### `_CFamily`

[`src/orchestrator/pkg/scope.py:410`](../../src/orchestrator/pkg/scope.py#L410)

- **Fields**: `call_nodes`, `scope_nodes`

### `_CSharp`

[`src/orchestrator/pkg/scope.py:318`](../../src/orchestrator/pkg/scope.py#L318)

- **Fields**: `call_nodes`, `scope_nodes`

### `_Go`

[`src/orchestrator/pkg/scope.py:287`](../../src/orchestrator/pkg/scope.py#L287)

- **Fields**: `call_nodes`, `scope_nodes`

### `_Lang`

[`src/orchestrator/pkg/scope.py:121`](../../src/orchestrator/pkg/scope.py#L121)

- **Extends** (1): `typing.Protocol`
- **Fields**: `call_nodes`, `scope_nodes`

### `_Open`

[`src/orchestrator/pkg/scope.py:139`](../../src/orchestrator/pkg/scope.py#L139)

- **Called by** (2): [`collect`](../../src/orchestrator/pkg/scope.py#L146), [`visit`](../../src/orchestrator/pkg/scope.py#L155)
- **Fields**: `bindings`, `end`, `local`, `start`

### `_TypeScript`

[`src/orchestrator/pkg/scope.py:239`](../../src/orchestrator/pkg/scope.py#L239)

- **Fields**: `call_nodes`, `scope_nodes`

## Functions

### `_c_parameters`

[`src/orchestrator/pkg/scope.py:397`](../../src/orchestrator/pkg/scope.py#L397)

- **Called by** (1): [`params`](../../src/orchestrator/pkg/scope.py#L416)

### `_declarator_name`

[`src/orchestrator/pkg/scope.py:378`](../../src/orchestrator/pkg/scope.py#L378)

- **Called by** (2): [`declares`](../../src/orchestrator/pkg/scope.py#L427), [`params`](../../src/orchestrator/pkg/scope.py#L416)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/scope.py#L134)

### `_idents`

[`src/orchestrator/pkg/scope.py:188`](../../src/orchestrator/pkg/scope.py#L188)

- **Called by** (2): [`_idents`](../../src/orchestrator/pkg/scope.py#L188), [`declares`](../../src/orchestrator/pkg/scope.py#L303)
- **Calls** (2): [`_idents`](../../src/orchestrator/pkg/scope.py#L188), [`_text`](../../src/orchestrator/pkg/scope.py#L134)

### `_named_fields`

[`src/orchestrator/pkg/scope.py:204`](../../src/orchestrator/pkg/scope.py#L204)

- **Called by** (2): [`declares`](../../src/orchestrator/pkg/scope.py#L303), [`params`](../../src/orchestrator/pkg/scope.py#L291)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/scope.py#L134)

### `_parser_for`

[`src/orchestrator/pkg/scope.py:466`](../../src/orchestrator/pkg/scope.py#L466)

- **Called by** (1): [`scopes_for_source`](../../src/orchestrator/pkg/scope.py#L491)
- **Calls** (5): [`_c_parser`](../../src/orchestrator/pkg/c_extractor.py#L497), [`_cpp_parser`](../../src/orchestrator/pkg/cpp_extractor.py#L515), [`_csharp_parser`](../../src/orchestrator/pkg/csharp_extractor.py#L727), [`_go_parser`](../../src/orchestrator/pkg/go_extractor.py#L506), [`_ts_parser`](../../src/orchestrator/pkg/typescript_extractor.py#L568)

### `_text`

[`src/orchestrator/pkg/scope.py:134`](../../src/orchestrator/pkg/scope.py#L134)

- **Called by** (8): [`_declarator_name`](../../src/orchestrator/pkg/scope.py#L378), [`_idents`](../../src/orchestrator/pkg/scope.py#L188), [`_named_fields`](../../src/orchestrator/pkg/scope.py#L204), [`_ts_pattern_names`](../../src/orchestrator/pkg/scope.py#L223), [`declares`](../../src/orchestrator/pkg/scope.py#L344), [`declares`](../../src/orchestrator/pkg/scope.py#L272), [`params`](../../src/orchestrator/pkg/scope.py#L333), [`visit`](../../src/orchestrator/pkg/scope.py#L155)

### `_ts_pattern_names`

[`src/orchestrator/pkg/scope.py:223`](../../src/orchestrator/pkg/scope.py#L223)

- **Called by** (3): [`_ts_pattern_names`](../../src/orchestrator/pkg/scope.py#L223), [`declares`](../../src/orchestrator/pkg/scope.py#L272), [`params`](../../src/orchestrator/pkg/scope.py#L253)
- **Calls** (2): [`_text`](../../src/orchestrator/pkg/scope.py#L134), [`_ts_pattern_names`](../../src/orchestrator/pkg/scope.py#L223)

### `collect`

[`src/orchestrator/pkg/scope.py:146`](../../src/orchestrator/pkg/scope.py#L146)

- **Called by** (1): [`scopes_for_source`](../../src/orchestrator/pkg/scope.py#L491)
- **Calls** (3): [`FileScopes`](../../src/orchestrator/pkg/scope.py#L94), [`Scope`](../../src/orchestrator/pkg/scope.py#L64), [`_Open`](../../src/orchestrator/pkg/scope.py#L139)

### `scopes_for_source`

[`src/orchestrator/pkg/scope.py:491`](../../src/orchestrator/pkg/scope.py#L491)

- **Called by** (1 production · 2 test): [`scopes_for`](../../src/orchestrator/pkg/invention.py#L287), [`_bare`](../../tests/pkg/test_scope.py#L34), [`_shadowed`](../../tests/pkg/test_scope.py#L28)
- **Calls** (2): [`_parser_for`](../../src/orchestrator/pkg/scope.py#L466), [`collect`](../../src/orchestrator/pkg/scope.py#L146)

## Imports

`__future__.annotations`, `collections.abc.Iterable`, `collections.abc.Iterator`, `dataclasses.dataclass`, `dataclasses.field`, [`orchestrator.pkg.c_extractor`](orchestrator.pkg.c_extractor.md), [`orchestrator.pkg.cpp_extractor`](orchestrator.pkg.cpp_extractor.md), [`orchestrator.pkg.csharp_extractor`](orchestrator.pkg.csharp_extractor.md), [`orchestrator.pkg.go_extractor`](orchestrator.pkg.go_extractor.md), [`orchestrator.pkg.typescript_extractor`](orchestrator.pkg.typescript_extractor.md), `tree_sitter.Node`, `typing.Any`, `typing.Protocol`, `typing.TYPE_CHECKING`

## Imported by

[`orchestrator.pkg.invention`](orchestrator.pkg.invention.md), [`tests.pkg.test_scope`](../../tests/pkg/test_scope.py#L1)
