Skip to content

feat(actions): publish repository context to Pages - #423

Merged
fishmingyu merged 8 commits into
mainfrom
feat/pages-action
Aug 5, 2026
Merged

feat(actions): publish repository context to Pages#423
fishmingyu merged 8 commits into
mainfrom
feat/pages-action

Conversation

@fishmingyu

@fishmingyu fishmingyu commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

Add a zero-credential GitHub Pages path that builds a static repository Wiki and a matching portable, commit-addressed context artifact. The default fast route deploys the precomputed Wiki and packages BM25 without a model download or credential. The optional semantic route adds vectors through a local Hugging Face model or an explicit BYO OpenAI-compatible endpoint without serializing credentials.

The provider and static-export dependencies are merged. This PR is now independently reviewable against main. Closes #422 and advances H3 of #415.

Changes

  • Add codenib artifact pack and codenib publish with portable BM25/vector manifests, inert JSON vector documents, SHA-256 inventories, checkout identity checks, path normalization, and publication secret scanning
  • Add a reusable Pages workflow and composite Action with exact source-revision checkout, commit-addressed cache identity, fork guards, SHA-pinned actions, scoped credentials, and a hosted no-model smoke test
  • Keep fast secret-free, default semantic to local Hugging Face embeddings, and allow remote embeddings only through an explicit OpenAI-compatible route and optional caller secret
  • Keep the Pages surface precomputed while preserving BM25 and vector query capabilities in the separately downloadable artifact
  • Document the no-model starter, local semantic route, BYO endpoint route, cache semantics, security boundary, and portable artifact scope

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Performance improvement
  • Tests

Testing

  • Tests pass locally

  • Added new tests for the changes

  • full unit tier on the complete stack: 2658 passed, 10 skipped, 183 deselected

  • post-restack Action, artifact, static-export, CLI, and provider suite: 100 passed

  • portable-vector conversion and loader suite: 28 passed

  • strict MkDocs build

  • pre-commit run --all-files

  • GitHub-hosted no-model Action smoke passed

  • real pallets/itsdangerous@672971d6 canary: fast publication and artifact verification passed; CPU-local CodeRankEmbed and BYO OpenAI-compatible semantic builds both produced verified JSON-backed BM25/vector artifacts; configured credential scan was clean

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented code where the behavior is not self-explanatory
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

@fishmingyu
fishmingyu force-pushed the integration/hosted-product branch from dcec1aa to e9f17b4 Compare August 5, 2026 07:17
@fishmingyu
fishmingyu force-pushed the integration/hosted-product branch from e9f17b4 to f6dbe2c Compare August 5, 2026 08:18
@github-actions github-actions Bot added type/docs Documentation type/test Test-related type/chore Build, CI, dependency updates scope/compiler Index compiler, manifest, build integration scope/infra CI, packaging, repo config labels Aug 5, 2026
@fishmingyu
fishmingyu force-pushed the feat/pages-action branch 2 times, most recently from c6a7bce to 95592a8 Compare August 5, 2026 08:29
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.
@fishmingyu
fishmingyu changed the base branch from integration/hosted-product to main August 5, 2026 08:44
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.
Copilot AI lite review requested due to automatic review settings August 5, 2026 08:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@fishmingyu
fishmingyu marked this pull request as ready for review August 5, 2026 08:46
@fishmingyu
fishmingyu merged commit ab49706 into main Aug 5, 2026
5 of 6 checks passed
@fishmingyu
fishmingyu deleted the feat/pages-action branch August 5, 2026 08:48

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c5576def6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

relative=relative,
)
entry_data = entry.to_dict()
entry_data["path"] = relative

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve portable view paths before publishing manifests

When the downloaded context artifact is consumed by existing runtimes, this relative views/... path is passed through unchanged (for example, ServerContext.load() and the web registry load entry.path directly). Unless the caller happens to start the process from the artifact root, codenib mcp /tmp/context/repo_manifest.json will look for views/bm25 under the current working directory and fail to load the packaged BM25/vector views. Please either make the loaders resolve artifact-relative manifest paths from the manifest location, or write paths here in a form the current loaders can open.

Useful? React with 👍 / 👎.

Comment on lines +452 to +453
if output_dir == source or source in output_dir.parents:
raise ValueError(f"static export output must be outside the {label}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the default export path valid

When codenib export is run without --output, _run_export still defaults to manifest_path.parent / "static-wiki"; this new index-root overlap check rejects that exact default because it is inside manifest_path.parent. The documented/default export invocation now exits before building anything, so either move the default outside the index root or allow this owned subdirectory.

Useful? React with 👍 / 👎.

Comment on lines +49 to +51
name = str(key).strip().lower().replace("-", "_")
if name in _CREDENTIAL_FIELDS:
raise ValueError(f"{source} contains a credential field: {key}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize credential field names before checking them

For published artifacts, this check only lowercases and converts hyphens to underscores, so common credential keys such as accessToken, clientSecret, privateKey, or a generic secret do not match _CREDENTIAL_FIELDS and can be serialized into the portable manifest from legacy/custom view config or metadata. Use the same canonicalization/suffix coverage as the provider-route validation so these credential-shaped fields are rejected before publication.

Useful? React with 👍 / 👎.

metadata = json.loads(metadata_path.read_text(encoding="utf-8"))
if not isinstance(metadata, dict):
raise ValueError("portable BM25 metadata must be a JSON object")
metadata["project_root"] = "source"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve BM25 source content in portable artifacts

For an Action-uploaded context artifact there is no source/ directory, but this rewrite makes BM25CodeIndexer.search(..., return_code_content=True) try to open source/<file> and silently omit the snippet instead of using the copied documents.json page content. That leaves MCP BM25 results from the portable artifact without source evidence; either stage the source, resolve source to a real checkout, or fall back to the stored document content.

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added the scope/indexing FAISS, vector store, incremental pipeline label 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.

feat(actions): publish Wiki and context artifacts

2 participants