Skip to content

feat(web): export a versioned static Wiki artifact #416

Description

@fishmingyu

Parent: #415

Summary

Define and implement the first portable CodeNib artifact: a deterministic, serverless Wiki export that the packaged frontend can read from GitHub Pages or any static host.

This milestone establishes the compatibility boundary used later by the GitHub Action and artifact-backed MCP work. It must not add provider credentials, local absolute paths, or a hidden live-API dependency.

Scope

Export contract

Add a versioned export manifest with:

  • repository slug and canonical origin when available;
  • indexed commit and source fingerprint;
  • CodeNib/export schema versions;
  • builder profile and per-view capabilities;
  • source-location convention;
  • generation mode, model identity, prompt/policy version, and grounding summary;
  • relative paths plus integrity digests for exported payloads.

Export API-shaped JSON for repository metadata, Wiki tree, Wiki pages, and page dependency graphs. Dynamic operations such as chat and edge-label generation are explicitly unavailable in static mode. Source citations link to the canonical repository at the indexed commit; no machine-absolute source path is published.

Frontend adapter

Teach the packaged frontend to select a static data source through runtime configuration, preserve a configurable Pages base path, and render unavailable dynamic capabilities deliberately rather than issuing failing API calls.

CLI

Provide one documented command that consumes an existing compatible manifest and writes an export directory. The command is deterministic for the same repository state and generation cache. It fails on commit/fingerprint mismatch.

Safety

  • Reject output paths outside the export root.
  • Redact or reject absolute build-machine paths.
  • Scan serialized runtime configuration and payloads for known credential sources.
  • Never serialize API keys, bearer headers, Action tokens, or provider options containing secrets.
  • Keep the target repository clean.

Non-goals

  • Browser-side model inference.
  • Anonymous query-time semantic Ask.
  • A hosted CodeNib backend.
  • Action workflow implementation; that follows after this contract is stable.
  • Copying the full repository into the Pages artifact.

Acceptance Criteria

  • A small public fixture builds a Wiki export from an existing manifest.
  • The export is byte-stable across two unchanged runs apart from explicitly excluded build timestamps.
  • The site works under both / and a repository Pages prefix.
  • Overview, page navigation, citations, and an available dependency view render without a FastAPI process.
  • Dynamic features are visibly unavailable and make no network request to a missing API.
  • No absolute checkout path or test credential appears in the export.
  • A mismatched checkout or incompatible schema fails with an actionable message.
  • Focused Python, frontend, and browser smoke tests pass.

Proposed Ownership

  • Export schema/writer: codenib/web/
  • CLI surface: codenib/cli.py
  • Static data adapter and base-path routing: web/
  • Contract tests: test/web/

Verification Order

  1. schema and writer unit tests;
  2. CLI export smoke on the fixture repository;
  3. frontend unit/build checks;
  4. static-server Playwright smoke at root and nested base paths.

Effort

effort/large

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions