codenib.languages
¶
Central language metadata registry.
This module is intentionally declarative. The existing language support
surfaces do not all use the same canonical key yet: for example agent compile
keeps c distinct from cpp, while graph indexing routes c through
the C/C++ backend. LanguageSpec records those per-surface choices in one
place so new language work can add metadata without editing every router by
hand.
Classes:
| Name | Description |
|---|---|
ScipColdStartOption |
SCIP cold-start backend status for one language. |
LanguageSpec |
Declarative metadata for one CodeNib language family. |
LanguageCapability |
Derived support matrix row for one registered language. |
Functions:
| Name | Description |
|---|---|
get_language_spec |
Return the spec for a language key or general alias. |
normalize_language |
Normalize a raw language string to a registry key. |
normalize_chunker_language |
Normalize a raw language string for |
get_chunker_spec |
Return the LanguageSpec used by the chunker factory. |
normalize_graph_language |
Normalize a raw language string to the graph/LS backend key. |
normalize_agent_language |
Normalize a raw language string for agent compile scenarios. |
supported_agent_languages |
Return language scenario keys accepted by agent compile. |
chunker_language_aliases |
Return raw chunker aliases mapped to chunker language keys. |
chunker_languages |
Return canonical language keys accepted by repository chunking. |
chunker_class_paths |
Return chunker language keys mapped to chunker class paths. |
chunker_class_path |
Return the chunker class path for a raw chunker language. |
graph_language_aliases |
Return raw LS/graph aliases mapped to backend language keys. |
agent_language_aliases |
Return raw agent language aliases mapped to scenario keys. |
extension_to_language_map |
Return an extension-to-language map for the requested surface. |
extensions_for_language |
Return extensions for a language on the requested surface. |
graph_extensions_by_language |
Return graph backend language keys mapped to accepted extensions. |
graph_indexer_paths |
Return graph backend language keys mapped to cold-start indexer paths. |
graph_decoder_paths |
Return graph backend language keys mapped to graph decoder paths. |
graph_cold_start_backends |
Return graph backend language keys mapped to cold-start backend names. |
graph_indexer_path |
Return the cold-start indexer class path for a raw graph language. |
graph_decoder_path |
Return the graph decoder class path for a raw graph language. |
graph_cold_start_backend |
Return the cold-start backend name for a raw graph language. |
scip_cold_start_options |
Return languages mapped to configured SCIP cold-start options. |
scip_cold_start_option |
Return SCIP cold-start metadata for a language key or alias. |
scip_candidate_indexer_paths |
Return languages mapped to explicit candidate SCIP indexer class paths. |
scip_candidate_indexer_path |
Return an opt-in candidate SCIP indexer path for a language or alias. |
scip_cold_start_command_for_language |
Return the configured SCIP cold-start command for a language or alias. |
lsp_language_id_for_language |
Return the LSP language id for a raw graph language. |
lsp_command_for_language |
Return the configured LSP command for a raw graph language. |
incremental_patcher_paths |
Return graph backend language keys mapped to incremental patcher paths. |
incremental_patcher_path |
Return the incremental patcher class path for a raw graph language. |
core_decoder_languages |
Return languages accepted by the optional C++ core decoder. |
language_capability_rows |
Return a registry-derived language support matrix. |
ScipColdStartOption
dataclass
¶
ScipColdStartOption(
tool: str,
status: ScipColdStartStatus,
command: tuple[str, ...] = (),
command_env: str | None = None,
note: str = "",
)
SCIP cold-start backend status for one language.
active means the language's current cold-start graph backend is SCIP.
candidate means a known SCIP indexer exists, but CodeNib has not yet
promoted it to the primary backend because smoke, backend-alignment, decoder,
and parity gates are still open.
LanguageSpec
dataclass
¶
LanguageSpec(
key: str,
display_name: str,
aliases: tuple[str, ...] = (),
chunker_language: str | None = None,
chunker_aliases: tuple[str, ...] = (),
chunker_class: str | None = None,
chunker_pass_language: bool = False,
chunk_extensions: tuple[str, ...] = (),
gt_language: str | None = None,
gt_extensions: tuple[str, ...] = (),
graph_language: str | None = None,
graph_aliases: tuple[str, ...] = (),
graph_extensions: tuple[str, ...] = (),
agent_languages: tuple[str, ...] = (),
agent_aliases: tuple[tuple[str, str], ...] = (),
cold_start_backend: str | None = None,
graph_indexer: str | None = None,
graph_decoder: str | None = None,
scip_cold_start: ScipColdStartOption | None = None,
scip_candidate_indexer: str | None = None,
incremental_backend: str | None = None,
incremental_patcher: str | None = None,
lsp_language_id: str | None = None,
lsp_command: tuple[str, ...] = (),
lsp_command_env: str | None = None,
lsp_command_factory: str | None = None,
core_decoder: bool = False,
core_decoder_aliases: tuple[str, ...] = (),
)
Declarative metadata for one CodeNib language family.
LanguageCapability
dataclass
¶
LanguageCapability(
key: str,
display_name: str,
chunker: bool,
ground_truth: bool,
agent: bool,
graph_backend: str | None,
scip_cold_start: str,
incremental_backend: str | None,
lsp: bool,
core_decoder: bool,
core_parity: str,
)
Derived support matrix row for one registered language.
get_language_spec
¶
get_language_spec(language: str) -> LanguageSpec | None
Return the spec for a language key or general alias.
normalize_language
¶
normalize_chunker_language
¶
get_chunker_spec
¶
get_chunker_spec(language: str) -> LanguageSpec | None
Return the LanguageSpec used by the chunker factory.
Source code in codenib/languages.py
normalize_graph_language
¶
Normalize a raw language string to the graph/LS backend key.
normalize_agent_language
¶
supported_agent_languages
¶
Return language scenario keys accepted by agent compile.
chunker_language_aliases
¶
chunker_languages
¶
Return canonical language keys accepted by repository chunking.
chunker_class_paths
¶
Return chunker language keys mapped to chunker class paths.
Source code in codenib/languages.py
chunker_class_path
¶
Return the chunker class path for a raw chunker language.
graph_language_aliases
¶
Return raw LS/graph aliases mapped to backend language keys.
Source code in codenib/languages.py
agent_language_aliases
¶
extension_to_language_map
¶
Return an extension-to-language map for the requested surface.
Source code in codenib/languages.py
extensions_for_language
¶
Return extensions for a language on the requested surface.
Source code in codenib/languages.py
graph_extensions_by_language
¶
Return graph backend language keys mapped to accepted extensions.
Source code in codenib/languages.py
graph_indexer_paths
¶
Return graph backend language keys mapped to cold-start indexer paths.
graph_decoder_paths
¶
Return graph backend language keys mapped to graph decoder paths.
graph_cold_start_backends
¶
Return graph backend language keys mapped to cold-start backend names.
graph_indexer_path
¶
Return the cold-start indexer class path for a raw graph language.
Source code in codenib/languages.py
graph_decoder_path
¶
Return the graph decoder class path for a raw graph language.
Source code in codenib/languages.py
graph_cold_start_backend
¶
Return the cold-start backend name for a raw graph language.
Source code in codenib/languages.py
scip_cold_start_options
¶
scip_cold_start_options(include_aliases: bool = True) -> dict[str, ScipColdStartOption]
Return languages mapped to configured SCIP cold-start options.
Candidate entries are intentionally returned even when a language's active graph backend is still LSP or tree-sitter-only. They are planning metadata, not an enabled router path.
Source code in codenib/languages.py
scip_cold_start_option
¶
scip_cold_start_option(language: str) -> ScipColdStartOption | None
Return SCIP cold-start metadata for a language key or alias.
scip_candidate_indexer_paths
¶
Return languages mapped to explicit candidate SCIP indexer class paths.
These paths are opt-in only. They do not change a language's active graph backend and are used by smoke/profiling flows that intentionally evaluate a candidate SCIP cold-start route.
Source code in codenib/languages.py
scip_candidate_indexer_path
¶
Return an opt-in candidate SCIP indexer path for a language or alias.
scip_cold_start_command_for_language
¶
Return the configured SCIP cold-start command for a language or alias.
Source code in codenib/languages.py
lsp_language_id_for_language
¶
Return the LSP language id for a raw graph language.
Source code in codenib/languages.py
lsp_command_for_language
¶
Return the configured LSP command for a raw graph language.
Source code in codenib/languages.py
incremental_patcher_paths
¶
Return graph backend language keys mapped to incremental patcher paths.
incremental_patcher_path
¶
Return the incremental patcher class path for a raw graph language.
Source code in codenib/languages.py
core_decoder_languages
¶
Return languages accepted by the optional C++ core decoder.
Source code in codenib/languages.py
language_capability_rows
¶
language_capability_rows() -> tuple[LanguageCapability, ...]
Return a registry-derived language support matrix.
The matrix intentionally distinguishes tree-sitter-only languages from graph-capable languages with no core decoder. This makes serial-only/core parity coverage explicit instead of relying on skipped tests as a signal.