Repository navigation
TR-1495: files_in_index in lore's sync report and repo list - #12
Merged
Merged
Conversation
Member
Author
factory/review: pass at cd31cff (TR-1495)Reviewer: ashish-crew-reviewer Verified
Findings (none blocking)
Not verified
|
Member
Author
|
factory/review: changes (round 2, head bce20b5, reviewer Blocking
Earlier findings
Verified
Not verified
|
…/repos The number of files the repo's index holds after a run (indexed plus unchanged, never skipped or deleted ones), counted from the document rows in Postgres. Named files_in_index because /progress and /admin/pushes already return files_total for the files a run indexes or deletes.
ashish-bagri
force-pushed
the
factory/TR-1495
branch
from
November 19, 2026 11:31
bce20b5 to
a00ffae
Compare
Member
Author
factory/review: pass at
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TR-1495: https://linear.app/glassflow/issue/TR-1495/lore-a-sync-report-and-the-repo-list-say-how-many-files-the-repos
What changed
IndexReporthas a newfiles_in_index: how many files the repo's index holds after the run (indexed plus unchanged, never skipped or deleted ones). It is set by the first index, the bundle push and the incremental sync, and by an up to date sync, which indexes nothing and still says what the index holds.lore indexprints it too.files_in_index, notfiles_total, because/progressand/admin/pushesalready returnfiles_totalfor the files a run will index or delete (Ashish chose the rename, D402). Those two are unchanged.index_commit_staging(after Repo: embed before writing, batch the first index, one lock across processes #11) the count is taken in the last transaction of the run, the one that setsindexed_commit. A first index commits in batches; by then they are all committed, so the count holds them plus the last transaction's own writes.RepoItemofGET /v1/repos(and thePOST /v1/reposanswer) carriesfiles_in_index. The list is counted with one query for all repo sources of the tenant.count(*)over the source'sdocumentsrows in Postgres. It never walks the git tree. No migration.files_in_indexis#[serde(default)]where the CLI reads a report or a repo item back, so a newer CLI against an older server still works (it reads 0).docs/usage.mddocuments the field and says it is not thefiles_totalof the progress route.Release note (v0.8.x patch)
Checks
Tests in
tests/repo_files_in_index.rs(first index in 3 batches of 100; ticket checks 1 to 3 through sync and bundle push; skipped files not counted; the list counts each repo and only the caller's;POST /v1/reposof an existing repo) and intests/cli_repo.rs(the CLI push and its up-to-date path read 6). Each was broken and restored:push_indexes_full_then_incremental_then_nothingfails (0 vs 6).POST /v1/reposanswering 0 for an existing repo:a_sync_and_the_repo_list_count_the_files_the_index_holdsfails (0 vs 301).cli_repofails (0 vs 6).files_indexed + files_unchanged(2 vs 301), skipped files added (5 vs 3), list ignoring totals (0 for every repo).Run in
rust:1.95-trixieagainstpgvector/pgvector:pg17(the crew machine has no Rust toolchain):cargo fmt --allandcargo clippy --all-targets -- -D warnings: clean.cargo test --all-targets --no-fail-faston the rebased tree: 744 passed, 3 failed. Two arecli_searchtests (onnxruntime prints a cpuid warning on stderr in the arm64 container; they fail the same on cleanorigin/main). One wascli_repo::push_of_a_repo_without_commits_failswithPoolTimedOut(test database connection); it passes on rerun (13 of 13). After the last small edits (a batch size in the test setup, fmt)repo_files_in_indexandcli_repopass again.Notes
src/repo/mod.rsonly._succeeded,_adopt) readsfiles_in_indexand is separate.