codenib.integrations
¶
Compatibility providers for external coding-agent runtimes.
Modules:
| Name | Description |
|---|---|
agentless |
Classic Agentless repository context over manifest-backed views. |
cosil |
CoSIL localization tools over CodeNib manifest-backed source views. |
locagent |
LocAgent/OpenHands-compatible tools over CodeNib repository views. |
orcaloca |
OrcaLoca search-manager compatibility over CodeNib repository views. |
reponavigator |
RepoNavigator's published |
swe_explore |
SWE-Explore's ranked-region contract over CodeNib repository exploration. |
Classes:
| Name | Description |
|---|---|
IntegrationCapabilityError |
A required manifest view is missing, stale, or failed to load. |
RepositoryAdapter |
Read-only repository facts backed by one |
RepositoryEntity |
A stable adapter-local view of one graph vertex. |
RepositoryPathError |
A requested path is invalid or escapes the manifest repository. |
CodeNibSWEExploreExplorer |
Adapt CodeNib's native explorer to SWE-Explore's region protocol. |
SWEExploreContextRegion |
One source region in SWE-Explore's external coordinate system. |
SWEExploreResult |
One ranked result compatible with SWE-Explore's explorer protocol. |
IntegrationCapabilityError
¶
Bases: RuntimeError
A required manifest view is missing, stale, or failed to load.
RepositoryAdapter
¶
Read-only repository facts backed by one ServerContext.
Methods:
| Name | Description |
|---|---|
from_manifest |
Load one |
require_view |
Return a loaded view or raise with manifest-aware diagnostics. |
normalize_path |
Return a safe repository-relative POSIX path. |
read_range |
Read an inclusive 0-based range and return its actual bounds. |
containing_entity |
Return the narrowest symbol containing a 0-based source line. |
distance |
Return the shorter directed distance, or |
file_tree |
Render a deterministic tree from files represented in the graph. |
skeleton |
Render a language-neutral signature skeleton from graph ranges. |
Source code in codenib/integrations/_repository.py
from_manifest
classmethod
¶
Load one ServerContext and bind an adapter to it.
Source code in codenib/integrations/_repository.py
require_view
¶
Return a loaded view or raise with manifest-aware diagnostics.
Source code in codenib/integrations/_repository.py
normalize_path
¶
Return a safe repository-relative POSIX path.
Source code in codenib/integrations/_repository.py
read_range
¶
read_range(
file_path: str, start_line: int | None = None, end_line: int | None = None
) -> tuple[str, int, int]
Read an inclusive 0-based range and return its actual bounds.
Source code in codenib/integrations/_repository.py
containing_entity
¶
containing_entity(file_path: str, line: int) -> RepositoryEntity | None
Return the narrowest symbol containing a 0-based source line.
Source code in codenib/integrations/_repository.py
distance
¶
Return the shorter directed distance, or -1 if unresolved.
Source code in codenib/integrations/_repository.py
file_tree
¶
Render a deterministic tree from files represented in the graph.
Source code in codenib/integrations/_repository.py
skeleton
¶
skeleton(entity: RepositoryEntity) -> str
Render a language-neutral signature skeleton from graph ranges.
Source code in codenib/integrations/_repository.py
RepositoryEntity
dataclass
¶
RepositoryEntity(
vertex_id: int,
canonical_name: str,
display_name: str,
kind: str,
file_path: str,
qualified_name: str,
simple_name: str,
start_line: int | None,
end_line: int | None,
parent_name: str | None = None,
class_name: str | None = None,
)
A stable adapter-local view of one graph vertex.
Lines remain 0-based internally. Integrations convert them exactly once while formatting results for their external agent contract.
RepositoryPathError
¶
Bases: ValueError
A requested path is invalid or escapes the manifest repository.
CodeNibSWEExploreExplorer
¶
CodeNibSWEExploreExplorer(
explorer: RepositoryContextExplorer, *, include_snippets: bool = False
)
Adapt CodeNib's native explorer to SWE-Explore's region protocol.
Methods:
| Name | Description |
|---|---|
from_manifest |
Bind the protocol adapter to an existing CodeNib manifest. |
from_repository |
Resolve and validate the manifest bound to one checkout. |
prepare |
Load the native views selected for a benchmark query. |
explore |
Return at most |
Source code in codenib/integrations/swe_explore.py
from_manifest
classmethod
¶
from_manifest(
manifest_path: str | Path,
*,
include_snippets: bool = False,
policy: str = "auto",
budget: BudgetInput = "balanced",
level: str = "l2"
) -> "CodeNibSWEExploreExplorer"
Bind the protocol adapter to an existing CodeNib manifest.
Source code in codenib/integrations/swe_explore.py
from_repository
classmethod
¶
from_repository(
repo_path: str | Path,
*,
manifest_path: str | Path | None = None,
include_snippets: bool = False,
policy: str = "auto",
budget: BudgetInput = "balanced",
level: str = "l2"
) -> "CodeNibSWEExploreExplorer"
Resolve and validate the manifest bound to one checkout.
Source code in codenib/integrations/swe_explore.py
prepare
¶
prepare(query: str) -> RepositoryExplorePreparation
explore
¶
explore(*, instance_id: str, query: str, top_k: int = 5) -> list[SWEExploreResult]
Return at most top_k ranked, valid source regions.
top_k is a region-count cutoff. SWE-Explore's Recall@100/300/500
metrics apply a separate cumulative-line budget in the scorer.
Source code in codenib/integrations/swe_explore.py
SWEExploreContextRegion
dataclass
¶
SWEExploreResult
dataclass
¶
SWEExploreResult(
instance_id: str, score: float, regions: tuple[SWEExploreContextRegion, ...]
)