Skip to content

feat: sync evidence-pool retrieval onto shared demo corpus - #456

Merged
EricNGOntos merged 14 commits into
mainfrom
feat/wuchengke/retrieval-evidence-pool
Oct 8, 2026
Merged

EricNGOntos merged 14 commits into
mainfrom
feat/wuchengke/retrieval-evidence-pool

Conversation

@EricNGOntos

Copy link
Copy Markdown
Contributor

Summary

  • Keep the current agent explore loop (evidence pool, pick phase, empty evidence_text) on top of latest main.
  • Shared demo corpus reads go through the storage/revision layer; finish-ref resolution is gone because the pool already holds picked evidence.
  • Contracts that still expected the old tool-message history were updated to the new loop.

Test plan

  • make check
  • Focused retrieval shared tests (one pre-existing main failure: blank corpus.recall with db=None)
  • API retrieval contracts for evidence retention, session release, and document scope
  • Remote CI

Made with Cursor

EricNGOntos and others added 12 commits September 30, 2026 13:15
- Replaced the `refs` structure with an `evidence pool` in the `EpisodeResult` and related components, enhancing clarity in how evidence is managed and referenced.
- Updated the `finish` tool schema to remove the `refs` requirement, allowing for a more flexible approach to evidence handling.
- Refactored various functions and classes to accommodate the new evidence pool structure, including updates to the `debug_agent_explore_episode` script for improved output.
- Removed the deprecated `ref_resolution` module, streamlining the codebase and reducing complexity in evidence resolution processes.
- Adjusted tests to reflect changes in evidence handling, ensuring robust coverage of the new structure.
- Updated the `RetrievalQueryResponse` model to improve evidence descriptions, clarifying the structure of grouped evidence blocks.
- Refactored the `to_mcp_query_response` function to return a list of `TextContent` and `ImageContent`, ensuring a more structured output for evidence parts.
- Implemented grouping of evidence units by document and section path, improving the organization of evidence in responses.
- Adjusted tests to validate the new evidence grouping and response structure, ensuring comprehensive coverage of the updated functionality.
- Refactored the `to_mcp_query_response` function to utilize list comprehensions for improved clarity and performance in handling evidence parts.
- Updated the `compose_pool_evidence` function to simplify chunk row processing and ensure correct sorting of evidence units.
- Enhanced the `_evidence_fields` function to leverage the `group_evidence_units` utility for better organization of evidence in responses.
- Improved test coverage for evidence handling, validating the new structure and ensuring accurate output in various scenarios.
…structure

- Updated the `RetrievalQueryResponse` model to deprecate `evidence_text` and `answer_text`, clarifying that these fields are always empty and should not be used.
- Adjusted the `_evidence_fields` function to return an empty string for `evidence_text`, reflecting the removal of text projection for evidence.
- Removed the `flatten_parts` function and related tests, streamlining evidence handling and ensuring consistency in response structure.
- Updated tests to validate the new behavior, ensuring comprehensive coverage of the updated evidence processing logic.
…ogic

- Replaced deprecated `tokens_used_delta` and `tokens_used_total` fields with `round_index` in the agent exploration steps, enhancing clarity in tracking rounds.
- Introduced a new `_evidence_preview` function to standardize evidence rendering across various components, improving consistency in evidence presentation.
- Updated the `EpisodeBudget` class to remove token limit handling, focusing on step and wall-clock management for exploration episodes.
- Refactored the `EvidencePool` class to support round-based evidence management, allowing for clearer handling of evidence across multiple rounds.
- Adjusted related tests and documentation to reflect these changes, ensuring comprehensive coverage of the updated evidence processing logic.
- Streamlined the `EvidencePool` class by directly assigning decisions to keys, simplifying the decision-making process.
- Updated the pick phase instructions for clarity, ensuring users understand the expected actions during this phase.
- Improved error handling in the `OpenAIHarness` class by validating pick arguments and providing clear error messages for invalid inputs.
- Removed deprecated token tracking from the `TraceRecorder`, focusing on relevant metrics for decision tracing.
- Added tests to validate the new pick argument validation logic, ensuring robust coverage of the updated functionality.
…cture

- Modified the `explore_mount.py` to focus solely on `corpus.recall` hits, enhancing clarity in the documentation.
- Enhanced the `grep.py` tool to support multiple term queries, allowing results to be organized by term and improving the visibility of less common terms.
- Updated the response structure to fold leftover sections per document, providing a more concise output.
- Adjusted tests to reflect changes in the grep tool's behavior, ensuring accurate validation of term handling and response formatting.
…ement

- Modified the evidence handling logic to replace deprecated `evidence_text` with a new `queried_tables` structure, enhancing clarity in evidence retrieval.
- Implemented a mechanism to record the last successful HTML output from table queries, ensuring accurate representation of queried data.
- Updated various functions to utilize the new `queried_tables` mapping, improving the integration of table data within evidence composition.
- Enhanced tests to validate the new behavior of evidence handling and ensure comprehensive coverage of the updated functionality.
- Eliminated the `notes` field from the `EpisodeResult` class and associated functions, streamlining the data structure used in agent exploration.
- Updated tests and scripts to reflect the removal of `notes`, ensuring consistency across the codebase and maintaining functionality.
- Adjusted related components to enhance clarity and focus on essential attributes in episode results.
…eters

- Increased the character budget for evidence text from 12,000 to 15,000 to accommodate more detailed observations.
- Adjusted the maximum steps for agent exploration from 12 to 15, aligning with the new evidence handling logic.
- Updated related tests to reflect changes in budget usage and ensure accurate validation of the new configurations.
- Enhanced the cursor harness logic to properly track and manage exploration rounds, improving overall clarity and functionality.
- Deleted the `chunks.json`, `doc_nav.json`, and `manifest.json` files associated with the Alibaba Fiscal Year 2026 Interim Report, streamlining the document structure.
- Removed all page citation assets (images) related to the report, ensuring a clean slate for future updates or revisions.
- This cleanup enhances maintainability and reduces clutter in the document management system.
Resolve the shared-demo corpus overlap by keeping the current agent explore loop and adapting the contracts that still expected the old tool-message history.

Co-authored-by: Cursor <cursoragent@cursor.com>
# tool_name, original_chars, has_evidence, collapsed} — see _collapse_stale_tool_messages.
tool_message_log: list[dict[str, Any]] = []
turn_index = 0
stop_reason = "finished"
EricNGOntos and others added 2 commits October 8, 2026 17:11
The suite-level download path still hit object storage when only the artifact helper was patched.

Co-authored-by: Cursor <cursoragent@cursor.com>
String-path monkeypatches missed the function globals used by assemble in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
@EricNGOntos
EricNGOntos merged commit 65c0445 into main Oct 8, 2026
6 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.

2 participants