fix: account for skipped papers in novelty index validation#42
Open
ruizhengu wants to merge 1 commit intoAgentAlphaAGI:mainfrom
Open
fix: account for skipped papers in novelty index validation#42ruizhengu wants to merge 1 commit intoAgentAlphaAGI:mainfrom
ruizhengu wants to merge 1 commit intoAgentAlphaAGI:mainfrom
Conversation
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.
Description
This PR fixes the issue: #41
It fixes a bug where
validate_novelty_index(/Idea2Paper/Paper-KG-Pipeline/src/idea2paper/infra/index_preflight.py) would fail and throw aRuntimeErrorif any papers were skipped during the novelty index build process.Previously, the preflight check strictly required
paper_count == index_count. However, thebuild_novelty_index.pyscript legitimately skips papers (e.g., when API generation fails or paper content is missing) and logs them under theskippedkey inindex_manifest.json(e.g.,/Idea2Paper/Paper-KG-Pipeline/output/novelty_index__voyage-4/index_manifest.json).This change updates the validation logic to check that
index_count + skipped == paper_count, allowing the pipeline to proceed correctly even when some papers are skipped.Changes Made
validate_novelty_indexinsrc/idea2paper/infra/index_preflight.pyto calculate theexpectedcount by addingindex_countandskipped(defaulting to 0 if not present).expected == paper_count.Steps to Test
index_manifest.json(e.g.,/Idea2Paper/Paper-KG-Pipeline/output/novelty_index__voyage-4/index_manifest.json) will reportindex_count<paper_countand a non-zeroskippedvalue.python Paper-KG-Pipeline/scripts/idea2story_pipeline.py "test idea".RuntimeError: Novelty index build failed or incomplete.