Skip to content

CodeNib 0.2.5

CodeNib 0.2.5 brings repository Wikis closer to the way people and coding agents use them: generate a navigable Wiki from a public repository, keep its source evidence, and export the result for another reader or agent. Local CodeGraph setup adds a BM25-first start, Python graph preparation with Pyrefly, static entry-path navigation and checks for paths that bypass a declared guard.

Upgrade the environment running CodeNib and restart its MCP client:

python -m pip install --upgrade "codenib[graph,mcp]==0.2.5"
codenib --version

Generate, keep and share a repository Wiki

The public Wiki entry accepts a public GitHub repository and uses the existing Wiki pipeline to produce linked chapters, rather than a single repository summary. Generation shows actual model work and waiting states. Completed chapters and interrupted attempts survive refresh, so a visitor can return to the saved result.

Saved visitor Wikis begin as unlisted, link-readable results. An owner can explicitly publish a completed, source-checked Wiki to Browse. Generating a Wiki does not also publish it to the catalog. Writing-model selection and bounded generation make the provider choice and work visible; provider usage still belongs to the account authorizing generation.

Prepared and visitor Wikis share the architecture reader. Saved maps and source excerpts retain their captured source identity. Unsupported visual coverage is shown explicitly, and a selected static call path is labeled as such. The first-visit example, saved graph previews and static exports can be read without requesting a new model response. Optional configured image generation remains a separate provider-backed operation.

The web reader adds share cards, a seekable system-map film, schematic maps and a source pane that keeps line alignment and surrounding scroll position stable while readers switch examples.

Carry a source-checked Wiki into another workflow

The OKF exporter turns a complete, current cached Wiki into Open Knowledge Format v0.2 Markdown:

codenib export --format okf --wiki-config /path/to/qa_config.yaml \
  --wiki-repo psf__requests --output /path/to/requests-wiki

The bundle includes chapter navigation, exact source excerpts, source-version identities, evidence sidecars, indexes and a hashed file inventory. Export uses the existing immutable Wiki snapshot and atomic directory publication; it needs neither a frontend build nor a model call. Missing pages, failed checks or a source mismatch stop publication.

Add --agent-dir /path/to/consumer-checkout to maintain a discovery pointer in AGENTS.md, and in an existing CLAUDE.md. This explicit operation preserves instructions outside CodeNib's managed block and describes the Wiki as a recorded snapshot. It does not register MCP or promise that the snapshot matches later edits. Citation checks retain their actual verdicts; export does not create a claim-verification event.

Existing static story export remains available for browser publication.

Start with source retrieval and prepare graphs when needed

The default CodeGraph setup still prepares the graph and exposes the full tool surface. An optional setup starts with BM25 and bounded source retrieval:

codenib codegraph init /absolute/path/to/repository \
  --defer-graph --tool-surface explore

This exposes the composed explore_context tool. Deferred Python sessions prepare the graph in the background while the agent can already search source. Graph-dependent questions wait briefly, then report when preparation is still running. Initial setup, background preparation and later rebuilds all count toward the workflow cost.

Python graphs now use pinned Pyrefly 1.4.0 by default. Explicit scip-python selection and fallback remain available. Provider identity and source scope are checked before an existing graph is reused.

Deferred Python sessions using the full tool surface can also return bounded, source-bound definition candidates before graph preparation. These candidates are not complete Python name resolution. Ambiguous or unsupported cases retain the graph fallback; see the MCP support boundary.

Follow entry paths and check architectural boundaries

explore_context can return bounded static paths from indexed entry points to a requested symbol, together with source locations. Readable text output keeps source provenance, truncation and omitted-path diagnostics visible. Same-named methods and incomplete searches retain their ambiguity; these are selected static reference paths, not runtime traces.

The new codenib codegraph check command checks rules from .codenib/checks.yaml against the indexed graph. Use it to find paths that bypass a guard or a function that references a declared sanitizer:

codenib codegraph check /absolute/path/to/repository
codenib codegraph check /absolute/path/to/repository --base origin/main --json

Violations include a witness path and exit with status 1 for CI. Invalid or incomplete graphs stop the check. Rules describe static references and name-matched unresolved Python calls; passing a rule does not prove runtime security. See call-path rules for configuration and coverage limits.

Keep agent navigation aligned with edits

CodeGraph initialization now accepts uncommitted additions, edits, deletions and renames while preserving the checkout. Queries reject stale indexed facts after a source change. Rebuild explicitly with codenib codegraph init /path/to/repository --rebuild; the original MCP connection then reloads the new indexes.

Python fixes recover module, class-field and wildcard-reference identities, bind retrieval seeds to indexed source spans, and preserve complete requested function bodies within the delivery limits. BM25 adds camelCase token parts and retains validation tests without letting them crowd out implementation candidates. Go graph coverage includes test files and nested modules. LSP transport fixes preserve replies across reads and bound server teardown. Deferred retrieval also refreshes after edits, and shutdown cancels graph builds owned by the session. Additional Python fixes preserve enclosing-scope bindings and reject misleading PEP 695 and rebound-receiver identities.

Upgrade and evidence boundaries

The Wiki database remains SQLiteWikiStore behind the Wiki-only WikiStore facade. Existing SQLite entries and portable context artifacts remain supported. The legacy agentwiki_*.json migration ended in 0.2.3; it is not restored here. The source-only H1 hybrid-index experiment has been removed.

New codenib-contextbench and codenib-arb adapters support reproducible evaluation with recorded inputs and benchmark-native scoring. The ContextBench results, Agent Retrieval Bench results and grep/Jev evaluation retain their own protocols and limitations. They do not establish end-to-end coding-agent time or token savings for CodeGraph. Default-route promotion and claims of workflow benefit still require matched task evidence, including setup and update costs.