Repository navigation
Description
Split from #3916.
Problem The research store writes every fetched page as a record and marks no page as refused. The review drift list cannot show a record that the ingest refused, because no field and no check exist for it. ## Why this is deferred The store has no ingest check that refuses a page, and no field marks a refusal. The manual read path does not need that field, so this part waits for its own change. ## Acceptance criteria - The ingest SHALL write refused_at_ingest with a reason when the fetched page yields no text or a content type that is not HTML. - A test: an ingest run on a page with empty text writes one record with refused_at_ingest and its reason. - A test: the review manual lookup does not return a refused record and the drift list holds it with reason refused_at_ingest. - The tests SHALL use a recorded fake of Qdrant and SHALL make no network call.
Proposed design
Problem statement
The research store writes each fetched page as a record and marks no page as refused. The review drift list cannot show a refused record because no field holds the refusal. This item writes refused_at_ingest at ingest for a page with no text. It proves that the review lookup drops the record and the drift list names the reason. The content-type refusal is deferred to a new issue because the page fetch does not carry a media type.
Acceptance criteria
Requirement: Refuse a page with no text
The research store SHALL set refused_at_ingest to empty_text on a record whose PageText.text holds no non-whitespace character.
Scenario: A page with no text
- WHEN The test calls
ResearchStore.upsertwith aPageTextwhosetextis empty, and again with one whosetextis only whitespace, each with a different URL, using theqdrantandembedderfixtures. - THEN The
qdrantfixture holds two points in the research collection, and each point payload hasrefused_at_ingestequal toempty_text.
Requirement: Accept a page with text
The research store SHALL leave refused_at_ingest unset on a record whose PageText.text holds non-whitespace text.
Scenario: A page with text
- WHEN The test calls
ResearchStore.upsertwith aPageTextthat holds text, using theqdrantandembedderfixtures. - THEN The
qdrantfixture holds one point in the research collection, and its payload has norefused_at_ingestkey.
Requirement: Drop a refused record from the manual lookup
The review manual lookup MUST return no manual for a stored record that sets refused_at_ingest.
Scenario: A refused record in the store
- WHEN The test loads one record with
refused_at_ingestequal toempty_textinto theqdrantfixture, then runsload_matched_kb_manuals. - THEN The lookup returns no manual.
Requirement: Report a refused record in the drift list
The review drift list MUST show a stored record that sets refused_at_ingest with reason refused_at_ingest.
Scenario: A refused record in the drift list
- WHEN The test loads one record with
refused_at_ingestequal toempty_textinto theqdrantfixture, then runs the review report. - THEN The drift section of the report holds one line for that record that names the reason
refused_at_ingest.
Requirement: Run the new tests offline
Each new test MUST take its Qdrant client from the qdrant fixture and MUST make no network call.
Scenario: Offline test run
- WHEN The new tests of the research store and of the review lookup run with network access disabled.
- THEN Each test passes, and the store and the lookup use the client that the
qdrantfixture installs.
Existing Tool Considered
No alternatives check has run. The open, maintained qdrant-client library, which the repository already locks and uses through resolve_qdrant_client in src/devops_cli/ai/rag/indexer.py, covers the payload write and the payload filter that the drift list reads. It lacks the ingest policy: it cannot decide that a page with no text is refused, name the reason, or render the drift list. The change adds only that policy: about 15 lines, about 1k tokens to write, about 500 tokens for each later fix, and under half an hour.
Key questions
- Which field holds the refusal of a record, and what value does it hold?: The payload field
refused_at_ingestholds the reason text. It holdsempty_textwhentext.strip()is empty. An accepted record writes no key. The read side of refactor(ai): the review loop reads manuals from the index #3916 tests the field for a value. (best practice) [sources: openspec/changes/3916-the-review-loop-reads-manuals-from/specs/review-manual-index/spec.md, openspec/changes/3916-the-review-loop-reads-manuals-from/tasks.md, src/devops_cli/ai/research/store.py, docs/adr/0028-a-research-agent-composes-open-tools-and-a-research-index.md]- Chosen: A reason string in
refused_at_ingest. The read side of refactor(ai): the review loop reads manuals from the index #3916 tests the field for a value, and the operator keeps the cause. - Rejected: An ISO 8601 timestamp in
refused_at_ingest. It records when, not why. A page with no text and a page that is not HTML look the same. - Rejected: A boolean flag and a separate reason field. Two fields must agree, and the read side of refactor(ai): the review loop reads manuals from the index #3916 reads one field.
- Chosen: A reason string in
- Does the ingest keep a refused record or drop it?: It keeps the record with
refused_at_ingestset. The drift list reads stored records. A dropped record leaves no trace. (best practice) [sources: src/devops_cli/ai/research/store.py, src/devops_cli/ai/kb.py, src/devops_cli/review/report.py, openspec/changes/3916-the-review-loop-reads-manuals-from/specs/review-manual-index/spec.md]- Chosen: Keep the record with
refused_at_ingestset. The drift list reads stored records, and a dropped record leaves no trace for the operator. - Rejected: Drop the refused record. The drift list cannot show a record that the store does not hold.
- Chosen: Keep the record with
- Where does the ingest write a research record?:
ResearchStore.upsertinsrc/devops_cli/ai/research/store.pytakes aPageTextand a question. It builds the payload in_payloadand writes one Qdrant point. [sources: src/devops_cli/ai/research/store.py] - Does the store refuse a page with empty text today?: No. The research-store spec has the requirements
Refuse text with no fetchandRefuse a blank source URL, and no requirement that refuses empty text. The store writes the record. [sources: openspec/specs/research-store/spec.md, src/devops_cli/ai/research/store.py] - Which part of the read path does refactor(ai): the review loop reads manuals from the index #3916 deliver, and which part does this item deliver?: refactor(ai): the review loop reads manuals from the index #3916 adds
ManualIndexRecord,read_manual_index_records, the drift reason and the refused-record case. This item writes the field at ingest and adds the integration test. [sources: openspec/changes/3916-the-review-loop-reads-manuals-from/tasks.md, openspec/changes/3916-the-review-loop-reads-manuals-from/specs/review-manual-index/spec.md] - Does a research record carry a
kindfield that the reader of refactor(ai): the review loop reads manuals from the index #3916 filters on?: No._payloadinsrc/devops_cli/ai/research/store.pybuilds the research payload and writes nokindkey. This item writesrefused_at_ingestand nokind. [sources: src/devops_cli/ai/research/store.py, docs/adr/0028-a-research-agent-composes-open-tools-and-a-research-index.md, openspec/changes/3916-the-review-loop-reads-manuals-from/tasks.md]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Watched files
A commit on the default branch that changes one of these files starts the next refine round.
src/devops_cli/ai/kb.pysrc/devops_cli/review/report.py
Activity
devops-cli-service commentedon Nov 25, 2026
Both work on the research index for the review loop; #3916 reads manuals from the index, this candidate adds a refusal field at ingest.[-]feat(ai): refuse a research record at ingest and report it in the review drift list[/-][+]feat(ai): refuse a record at ingest and report in drift list[/+]devops-cli-service commentedon Nov 25, 2026
The job shortened the title of this item. The summary had 73 characters, and the limit is 60. The type and the scope stay.
feat(ai): refuse a research record at ingest and report it in the review drift listfeat(ai): refuse a record at ingest and report in drift listdevops-cli-service commentedon Nov 25, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.