Skip to content

fix(vector): close native index authority boundaries - #588

Merged
fishmingyu merged 12 commits into
mainfrom
fix/native-vector-authority-closure-v2
Aug 13, 2026
Merged

fix(vector): close native index authority boundaries#588
fishmingyu merged 12 commits into
mainfrom
fix/native-vector-authority-closure-v2

Conversation

@fishmingyu

@fishmingyu fishmingyu commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

Close native-vector authority and publication boundaries across compiler,
artifact, agent, MCP, Web, script, and cache consumers. The former stacked
dependencies through #587 are merged, and this branch is restacked directly
on current main.

Changes

  • Preserve lexical source boundaries through CLI, compiler, agent, and client
    entry points.
  • Require exact captured-tree and semantic-contract authorization before
    constructing embedding models, remote clients, pickle decoders, or FAISS
    parsers, and pass that same external capability through every native load.
  • Keep portable vector validation parser-inert; a descriptive trusted-local
    value no longer grants native access.
  • Publish vector files, cache state, incremental state, and update markers as
    one descriptor-anchored private generation with an atomic directory switch.
  • Disable live vector delta mutation until it can satisfy the same publication
    boundary; validated incremental requests use a safe complete-generation
    rebuild.
  • Preserve the first cache-lock and captured-view failure across cleanup
    faults.
  • Bind Web vector authorization to the complete repository source even when
    the manifest is stored at the repository root.
  • Isolate snapshot vector trees from profile symlinks and quality receipts so
    repeated strict captures remain valid.
  • Resolve publication output ancestors before overlap checks and use the same
    canonical paths for publication, preventing symlink redirects into source or
    index state.
  • Document the publication and compatibility gates in the incremental and
    storage roadmaps.

Platforms without a descriptor-anchored path for native writers fail closed
before model construction instead of using a replaceable build pathname.

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: 5167 passed, 71 skipped, 190 deselected.

  • Changed-surface unit sweep: 793 passed, 11 deselected.

  • Focused manifest, snapshot-layout, and publication-output regressions:
    38 passed.

  • Pre-commit passed across the complete 62-file branch diff, including Black,
    isort, flake8, namespace checks, and git diff --check.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

The branch is based directly on main at
1de7d18f7480491ca050d7a7a09f22a7a5723a58.

@github-actions github-actions Bot added type/test Test-related scope/indexing FAISS, vector store, incremental pipeline scope/agent Agent runner, skills, tool execution scope/compiler Index compiler, manifest, build integration labels Aug 11, 2026
@fishmingyu
fishmingyu force-pushed the fix/native-vector-authority-closure-v2 branch from ba71286 to 9f6b535 Compare August 11, 2026 21:46
@github-actions github-actions Bot added the type/docs Documentation label Aug 11, 2026
@fishmingyu
fishmingyu marked this pull request as ready for review August 11, 2026 21:47

@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: 9f6b5353ad

ℹ️ 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".

Comment thread codenib/web/native_authority.py Outdated
Comment thread scripts/embeddings/build_embeddings.py
Comment thread codenib/cli.py Outdated
@fishmingyu
fishmingyu marked this pull request as draft August 12, 2026 22:31
@fishmingyu
fishmingyu force-pushed the fix/source-fingerprint-authority-v2 branch from 2213624 to b856efd Compare August 13, 2026 20:14
Base automatically changed from fix/source-fingerprint-authority-v2 to main August 13, 2026 20:43
Require exact captured-tree authorization before native parsing in compiler, agent, pipeline, script, and example call sites. Distinguish missing capabilities from malformed or mismatched capabilities so only absence can select a safe source rebuild.

Keep local administrative minting at explicit source-bound boundaries and preserve cleanup failures without hiding the first exception.
Build vector files, cache state, and update markers through a descriptor-anchored private generation before one owned-directory switch. Reject generation-root replacement without writing through attacker-controlled paths.

Disable live incremental mutation until it can satisfy the same boundary; validated requests take the complete-generation rebuild path and preserve the previous tree under BaseException faults.
Authenticate FAISS payload bytes and canonical metadata without importing native parsers or deserializing pickle. Treat trusted-local as descriptive only and require an exact out-of-band capability for any native normalization.

Bind context staging minting to the verified checkout, persisted config fingerprint, and copied tree while preserving first-primary cleanup failures.
Keep the first entry or body BaseException authoritative when POSIX or Windows lock cleanup also fails. Complete descriptor and registry cleanup, retain secondary diagnostics, and propagate cleanup itself when no earlier fault exists.
Require a resolver for hybrid native views unless the caller explicitly chooses optional sparse fallback. Mint local capabilities outside the registry only under the compiler cache lock after exact manifest, source-fingerprint-v2, and captured-tree checks.

Keep legacy route defaults out of the capability semantic contract and reject wrong-tree or wrong-config tokens before model construction.
Document parser-inert portable validation, descriptor-anchored whole-generation publication, source-bound Web authorization, and the temporary full-rebuild behavior for vector incremental requests.
Keep external native-index capabilities intact through cached loads. Isolate snapshot vector trees from profile and quality metadata, and resolve publication output ancestors before overlap checks.

Preserve root-level manifest source coverage and cleanup failure ownership.

Verified with 793 changed-surface unit tests, the full 5167-test unit tier, and pre-commit across the complete branch diff.
@fishmingyu
fishmingyu force-pushed the fix/native-vector-authority-closure-v2 branch from 9f6b535 to f0bfcef Compare August 13, 2026 21:22
@fishmingyu
fishmingyu marked this pull request as ready for review August 13, 2026 21:31
@fishmingyu
fishmingyu merged commit 16be1b2 into main Aug 13, 2026
24 checks passed
@fishmingyu
fishmingyu deleted the fix/native-vector-authority-closure-v2 branch August 13, 2026 21:35

@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: f0bfcefa09

ℹ️ 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".

Comment thread codenib/web/local.py
Comment on lines +92 to +94
source_binding = capture_repository_source(
repo_path,
exclude_roots=(manifest_path.parent,),

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 Avoid excluding the repository for root-level manifests

When manifest_path.parent == repo_path, this passes the repository root as an exclusion, so the captured fingerprint always represents zero files. A manifest produced with a root-level custom cache (cache_dir == repo_path) can therefore retain the same valid v2 fingerprint and file_count == 0 after arbitrary source changes, allowing prepare_local_wiki to accept stale sparse/BM25 indexes for the wrong checkout. Although native_authority now handles this case, this independent unconditional exclusion remains in prepare_local_wiki; exclude only the manifest file and lock when the parent is the repository root.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/agent Agent runner, skills, tool execution scope/compiler Index compiler, manifest, build integration scope/indexing FAISS, vector store, incremental pipeline type/docs Documentation type/test Test-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant