Skip to content

feat(mcp): serve verified repository context artifacts - #425

Draft
fishmingyu wants to merge 18 commits into
mainfrom
feat/artifact-mcp
Draft

feat(mcp): serve verified repository context artifacts#425
fishmingyu wants to merge 18 commits into
mainfrom
feat/artifact-mcp

Conversation

@fishmingyu

Copy link
Copy Markdown
Member

Summary

Add a verified, commit-bound path from portable CodeNib context artifacts to the MCP runtime. This lets an agent reuse the exact artifact produced by the GitHub Pages workflow without rebuilding repository views locally.

This PR is stacked on #423 and addresses #424.

Changes

  • convert portable vector documents to inert JSON and retain pickle loading only for trusted local and legacy indexes
  • verify artifact schema, inventory, hashes, source fingerprint, manifest identity, capabilities, and serving payloads before loading an index
  • reject traversal, duplicate, symlink, special-file, encrypted, oversized, and malformed archive inputs
  • fetch an exact commit and canonical artifact name from GitHub Actions while keeping API credentials off signed object-storage requests
  • bind artifacts to an exact Git checkout and reject source paths that escape through symlinks
  • add artifact verify, artifact fetch, and artifact mcp-config commands
  • allow codenib mcp to serve a verified artifact directly and report its provenance through get_manifest
  • document the GitHub Pages-to-MCP workflow and credential boundary

Portable graph and Zoekt payloads remain outside this milestone; unsupported views are reported explicitly.

Type of Change

  • Feature
  • Refactor
  • Documentation
  • Tests
  • Bug fix
  • Breaking change

Testing

  • full unit tier: 2651 passed, 10 skipped, 183 deselected
  • artifact tier: 36 passed
  • pre-commit run --all-files
  • strict MkDocs build
  • built the wheel and installed it into a fresh virtual environment
  • indexed a fresh Git fixture, packed and verified its context artifact, started stdio MCP from the installed wheel, negotiated MCP protocol 2025-11-25, listed 9 tools, verified exact repository/commit/view provenance, and returned calculator.py from BM25

Checklist

  • Changes are focused on artifact verification and MCP reuse
  • No downloaded pickle payload is loaded
  • Artifact and checkout identity are checked before serving
  • Tests cover malformed archives, forged metadata, cache bounds, and symlink escapes
  • Documentation describes supported views and credential boundaries
  • This PR remains draft until stacked dependency feat(actions): publish repository context to Pages #423 is merged or restacked

Persist only canonical provider, model, endpoint, dimension, and vector-semantic options in embedding artifact identity. Rebind credentials at runtime and reject incompatible provider substitutions across compiler, MCP, skills, and Wiki loaders.

Verified with the full unit tier (2568 passed), focused provider/runtime tests (183 passed), and pre-commit.
@fishmingyu
fishmingyu force-pushed the feat/artifact-mcp branch 2 times, most recently from 10d3819 to cd94609 Compare August 5, 2026 07:26
Infer the provider only for legacy prebuilt manifests that predate route identity, and persist provider and endpoint metadata in newly generated QA manifests.
Add provider-aware semantic indexing, manifest-authoritative Wiki reopening, redacted doctor probes, and process-local credential delivery for GitHub Models and BYO OpenAI-compatible services.\n\nVerify remote embedding construction through a local OpenAI-compatible server and cover route mismatch, dependency, packaging, and secret-regression boundaries.
Explain GitHub Models and BYO embedding/chat setup, workflow permission requirements, artifact compatibility identity, billing boundaries, and the guarantee that credentials never enter manifests or static exports.
Mount only document startup assets at the Pages base path so generated query and hash links keep browser-relative semantics. Detect JSON-escaped build paths during publication validation.
Add commit-validated BM25/vector serving artifacts and a publish CLI that pairs them with static Wiki exports. Keep credentials, machine paths, mutable vector state, and overlapping output roots out of distributable data.\n\nVerified with focused artifact/CLI/static-export tests and the full unit tier.
Add a reusable no-model or semantic publishing workflow that builds the static Wiki and matching commit-addressed context artifact. Bind cache and artifact identity to the indexed checkout, constrain credential exposure, reject unsafe inputs, and document GitHub Models and BYO routes.\n\nVerified with the full unit tier, pre-commit, action-validator, and strict MkDocs build.
Lowercase repository identity before deriving the default artifact name so GitHub lookup and cache consumers use one stable owner/repository spelling.\n\nVerified with the Action tests, action-validator, and pre-commit.
Convert trusted local vector document pickles into inert JSON when packaging query-serving artifacts. Prefer that portable format at load time while retaining the legacy pickle fallback for local indexes.

Verified with focused artifact and vector-store tests.
Verify commit-addressed BM25/vector artifacts before opening persisted indexes, fetch exact workflow artifacts without forwarding GitHub credentials, and bind source locations to an unchanged checkout.

Add artifact verify/fetch/config CLI routes, artifact-backed MCP startup, path and archive guardrails, provenance reporting, documentation, and adversarial tests.
Base automatically changed from feat/pages-action to main August 5, 2026 08:48
@github-actions github-actions Bot added type/docs Documentation type/test Test-related labels Aug 5, 2026
@github-actions github-actions Bot added type/chore Build, CI, dependency updates scope/indexing FAISS, vector store, incremental pipeline scope/compiler Index compiler, manifest, build integration scope/infra CI, packaging, repo config labels Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/compiler Index compiler, manifest, build integration scope/indexing FAISS, vector store, incremental pipeline scope/infra CI, packaging, repo config type/chore Build, CI, dependency updates type/docs Documentation type/test Test-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant