Skip to content

feat(index): integrate bulk planning and indexing - #166

Merged
tulayha merged 7 commits into
mainfrom
bulk-index-integration
Sep 14, 2026
Merged

tulayha merged 7 commits into
mainfrom
bulk-index-integration

Conversation

@tulayha

@tulayha tulayha commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Related issue

Closes #68 when ready to merge. Integrates #157 and #158; both were retargeted and merged into this branch with their original commits preserved.

Summary

Add one vidxp index bulk command for explicit media IDs or --all, with --plan-only, indexing options, per-video and overall progress, JSON summaries, and detached submission. This is user-visible behavior; no storage schema change or automatic index migration.

The integration keeps @Hasnain2430's typed planning, preview, checksum checks and skip reasons, and @aimerscrypto's reusable runner, job submission, option forwarding and progress callbacks. Planning is available on the model-free control plane. Single indexing and bulk planning use the same validated configuration construction. A saved generation is skipped only when its content checksum and configuration fingerprint match; failed submitted jobs retain their IDs for retry. Each video still uses an ordinary durable indexing job.

The existing rule that an active repository uses one indexing profile remains in force. This PR does not silently clear old results or migrate a multi-video repository to different settings. Incompatible jobs report the existing error.

Validation

  • PYTHONPATH=src /Users/grayhat/Developer/vidxp/.venv/bin/python -m pytest -q tests/test_bulk_index.py tests/test_bulk_indexing.py — 32 passed, 3 subtests passed.
  • PYTHONPATH=src /Users/grayhat/Developer/vidxp/.venv/bin/python -m pytest -q tests/test_bulk_index.py tests/test_bulk_indexing.py tests/test_application.py tests/test_control_plane.py tests/test_job_contracts.py tests/test_cli.py tests/test_local_snapshots.py — 148 passed, 7 subtests passed, 2 failed. Both failures are UI tests that require the absent Streamlit dependency; reproduced both failures on the unchanged checkout. No bulk/application/planning failures.
  • /Users/grayhat/Developer/vidxp/.venv/bin/ruff check . — passed.
  • PYTHONPATH=src /Users/grayhat/Developer/vidxp/.venv/bin/python -m vidxp.cli index bulk --help — passed.
  • /opt/homebrew/bin/git diff --check — passed.
  • Real offline smoke via /private/tmp/bulk-real-smoke.py: generated two H.264 videos with FFmpeg, imported them into an isolated repository, and indexed both using the cached SigLIP2 model through real durable worker jobs. Repeating the plan skipped both; changing sampling scheduled both again. Passed.
  • Real failure/retry/search smoke via /private/tmp/bulk-real-retry.py: temporarily withheld one imported video's stored content in the isolated repository. Its submitted job failed and retained its ID, while the next video indexed successfully. Restored the content, verified the plan selected only the failed item, retried its job independently, and searched all four indexed videos. Passed. No model downloads or changes to the user's media/indexes.
  • The first smoke attempt used the wrong model-cache path because the temporary data directory changes that default. Explicitly selecting the existing model cache resolved this setup error; no product workaround was needed.
  • npx --yes markdownlint-cli2@0.23.2 INSTALLATION_GUIDE.md — passed. Lychee is unavailable locally; local-link checking and the full validation suite remain for CI. No application builds or full suite run locally.

Real indexing, skip behavior, failure isolation, independent retry and search have been exercised. Required CI must pass before merging. Transformers emitted existing model-config warnings about BOS/EOS token IDs while the real search completed successfully.

Contributor credit

Both original contributor commits are retained. If squash merging, retain both coauthor trailers in the final commit:

Co-authored-by: umair i250604@isb.nu.edu.pk
Co-authored-by: Hasnain Ibrar Hasnain2430@gmail.com

aimerscrypto and others added 5 commits September 8, 2026 13:53
`vidxp index create` handled one media item per invocation, so indexing a
repository meant driving it once per video and tracking the results by
hand.

Add a transport-neutral planning operation and a thin CLI adapter over
it:

- `Application.plan_bulk_index` resolves a selection to per-media targets
  and decides which ones the active snapshot already covers. The plan is
  read-only, so callers can show it before committing to any work.
- `vidxp index bulk` indexes every registered media item, or a selection
  passed with repeated `--media-id`. `--plan-only` shows the decision
  without indexing, and `--reindex` plans covered media anyway.

Media is skipped when the active snapshot holds a generation for it, that
generation covers every requested modality, and its recorded input
checksum still matches the registered media. Replacing a video's content
or asking for a modality the generation lacks therefore plans it again.
Media that is not in the ready state is reported as skipped rather than
silently dropped.

No new indexing behavior. Each pending target is submitted through the
existing `submit_index` durable job, one job per media item, matching how
`IngestionCoordinator` already sequences ingestion. That is what gives
the batch its guarantees: a failure isolates to its own media, earlier
successes stay committed, and rerunning the command retries only what is
still missing because completed media is then skipped. The command exits
non-zero when any media failed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tulayha
tulayha marked this pull request as ready for review September 14, 2026 11:46
@tulayha
tulayha merged commit 0a48ed8 into main Sep 14, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add bulk video indexing

3 participants