Skip to content

G138: add topic range index search - #358

Merged
delete-cloud merged 1 commit into
mainfrom
codex/cross-topic-memory-g138-topic-range-index
May 23, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
codex/cross-topic-memory-g138-topic-range-index

Conversation

@delete-cloud

@delete-cloud delete-cloud commented May 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add deterministic product-layer TopicRangeIndex for finalized topic summaries
  • support search by text, kind/profile, Bee template, tags, status, and created-at bounds
  • attach sanitized Bee task/report/evidence metadata and reject raw/secret-shaped text

Verification

  • uv run pytest tests/coding_agent/test_topic_range_index.py -v
  • uv run pytest tests/coding_agent/test_topic_recall.py tests/coding_agent/test_topic_layer_smoke.py -v
  • uv run ruff format --check --preview docs/cross_topic_memory/GOAL_PROGRESS.md docs/adr/0046-cross-topic-memory-and-topic-range-search.md src/coding_agent/topic_range_index.py tests/coding_agent/test_topic_range_index.py
  • uv run ruff check src/coding_agent/topic_range_index.py tests/coding_agent/test_topic_range_index.py
  • git diff --check -- .

Local reviewer: initial sanitizer blocker fixed; re-review found no blockers.

Summary by CodeRabbit

  • New Features

    • Added topic range indexing and multi-field search capability. Users can now search topics by text content, kind, profile, tags, status, and creation date ranges with deterministic result scoring.
    • Added input validation to prevent indexing and searching of sensitive content patterns.
  • Tests

    • Comprehensive test coverage for topic indexing, search filtering, metadata handling, and security validation.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 23, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6b13832b-457f-4c85-a6fd-7d3fcbadee50

📥 Commits

Reviewing files that changed from the base of the PR and between e6c0a6e and af69272.

📒 Files selected for processing (4)
  • coding-agent/docs/adr/0046-cross-topic-memory-and-topic-range-search.md
  • coding-agent/docs/cross_topic_memory/GOAL_PROGRESS.md
  • coding-agent/src/coding_agent/topic_range_index.py
  • coding-agent/tests/coding_agent/test_topic_range_index.py

📝 Walkthrough

Walkthrough

This PR implements a deterministic in-memory topic range index with search capability, supporting filtered queries across finalized topics via text, metadata, and temporal constraints. The implementation includes comprehensive validation rejecting forbidden content markers and unsafe inputs, with full test coverage and documentation of completion.

Changes

Topic Range Index and Search

Layer / File(s) Summary
Data contracts and validation constants
src/coding_agent/topic_range_index.py (lines 1–144)
Forbidden raw-content marker constants; immutable dataclasses TopicRangeIndexDocument, TopicRangeSearchQuery, and TopicRangeSearchResult with __post_init__ validation for safe IDs, non-empty fields, and forbidden marker rejection.
Index storage and search execution
src/coding_agent/topic_range_index.py (lines 146–222)
TopicRangeIndex.index_topic conditionally stores topics, rejecting open topics unless explicitly allowed; TopicRangeIndex.search filters indexed documents by kind/profile/template/status/tags/dates and ranks results by deterministic token overlap.
Search filtering, scoring, and validation helpers
src/coding_agent/topic_range_index.py (lines 224–318)
_matches_filters applies query constraints; _score_document computes token overlap ratio; _document_text assembles searchable text; _tokens deterministically tokenizes; validation helpers enforce ID/ref/text safety and forbidden marker rejection.
Comprehensive test coverage
tests/coding_agent/test_topic_range_index.py
Tests verify indexing finalized topics by default, skipping open topics unless allow_open=True, search filtering across text/kind/profile/tags/status/time bounds, bee task metadata inclusion, and input validation rejecting forbidden raw-content markers and secret-like search text.
ADR and progress documentation
docs/adr/0046-cross-topic-memory-and-topic-range-search.md, docs/cross_topic_memory/GOAL_PROGRESS.md
ADR-0046 acceptance criteria marked complete; GOAL_PROGRESS.md documents G138 completion with intended artifacts, verification commands, stop criteria, and resulting deterministic indexing/search/validation capabilities.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

A rabbit indexes topics with care,
Searching through memories fair,
Tokens aligned, forbidden markers banned,
Finalized content at command—
Safe determinism, tested well prepared! 🐰

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/cross-topic-memory-g138-topic-range-index

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@delete-cloud
delete-cloud merged commit a4e776b into main May 23, 2026
1 check was pending
@delete-cloud
delete-cloud deleted the codex/cross-topic-memory-g138-topic-range-index branch May 23, 2026 11:45
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.

1 participant