Skip to content

feat(ai): refuse a record at ingest and report in drift list #7058

Backlog

Description

@devops-cli-service

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.upsert with a PageText whose text is empty, and again with one whose text is only whitespace, each with a different URL, using the qdrant and embedder fixtures.
  • THEN The qdrant fixture holds two points in the research collection, and each point payload has refused_at_ingest equal to empty_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.upsert with a PageText that holds text, using the qdrant and embedder fixtures.
  • THEN The qdrant fixture holds one point in the research collection, and its payload has no refused_at_ingest key.

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_ingest equal to empty_text into the qdrant fixture, then runs load_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_ingest equal to empty_text into the qdrant fixture, 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 qdrant fixture 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_ingest holds the reason text. It holds empty_text when text.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]
  • Does the ingest keep a refused record or drop it?: It keeps the record with refused_at_ingest set. 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_ingest set. 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.
  • Where does the ingest write a research record?: ResearchStore.upsert in src/devops_cli/ai/research/store.py takes a PageText and a question. It builds the payload in _payload and 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 fetch and Refuse 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 kind field that the reader of refactor(ai): the review loop reads manuals from the index #3916 filters on?: No. _payload in src/devops_cli/ai/research/store.py builds the research payload and writes no kind key. This item writes refused_at_ingest and no kind. [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

#3916

Watched files

A commit on the default branch that changes one of these files starts the next refine round.

  • src/devops_cli/ai/kb.py
  • src/devops_cli/review/report.py

Activity

  1. added
    type/feature
    scope/ai
    source/agent
    status/new
    value/medium
    on Nov 25, 2026
  2. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor
  3. added
    effort/medium
    priority/p2-medium
    on Nov 25, 2026
  4. changed the title [-]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[/+] on Nov 25, 2026
  5. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor

    The job shortened the title of this item. The summary had 73 characters, and the limit is 60. The type and the scope stay.

    • Before: feat(ai): refuse a research record at ingest and report it in the review drift list
    • After: feat(ai): refuse a record at ingest and report in drift list
    • Source of the summary: the background model
  6. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/aisource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions