Repository navigation
Description
Problem or Motivation
The RAG point payload (src/devops_cli/ai/rag/indexer.py) has no commit and no document class. Thus:
- a hit cannot become a citation at a SHA;
- records and history sections cannot be filtered out;
- a superseded ADR looks current.
The indexer skips hidden folders, so the .agents/skills skills are not indexed. The knowledge base is in Qdrant two times.
Proposed Solution & Architectural Design
This is child 13 of #4880, under the brain tracker #4624.
- Add these fields to each point:
commit(the ingest head ofingest.py),doc_class(document_class()ofsrc/devops_cli/docs/inventory.py),generated_from(the map of feat(docs): generated pages name their source and stay complete #4889) andadr_status(src/devops_cli/roadmap/adr.py). Print them in the retriever context (retriever.py). - Index
.agents/skills/**/SKILL.mdas an explicit include. - By default, brain search leaves out
openspec/changes,docs/agent/archiveand test fixtures. It gives an ADR with its status. - The knowledge base comes only from the tree copy (refactor(ai): drop the knowledge base copies of project docs #3917).
- Run one reindex. The trigger stays the rag-ingest CronWorkflow (every 3 minutes) after feat(k8s): let Argo Workflows run roadmap pods in devops #4566 fixes it.
Add an OpenSpec spec delta for the project-brain capability (a new capability if no change has added it yet). Update the RAG text of k8s/README.md and ARCHITECTURE.md.
Target Subsystem
AI & Agentic Review Pipeline (RAG index: src/devops_cli/ai/rag/), with the project brain.
Existing Tool Considered
Qdrant payload fields and filters on the existing collection. Cost: about 150 lines plus tests, about 150k tokens and 3 h.
Acceptance Criteria
- A test indexes a fixture repository, and each point has
commit,doc_classand, for a generated page,generated_from. - A superseded ADR point has
adr_statussuperseded. - A
SKILL.mdunder.agents/skillsis indexed. - A search with the default filter returns no point of
openspec/changes. - The knowledge base text is in one Qdrant project.
Dependencies
#4884, #4889, #3917. The scheduled reindex waits for #4566.
Source: #4880
Alternatives check of 2026-11-21: in-use.
The repository already uses this tool.
Tool: qdrant/qdrant (https://github.com/qdrant/qdrant), Apache-2.0, last activity 2026-11-20, maintained.
Reason: Searches found no open tool that computes the project's commit, document class, generated_from map or ADR status; Qdrant, already in use, stores the payload fields and filters on them, while the indexer and retriever changes remain project code.
Covers:
- Stores arbitrary JSON payload fields on each point
- Keyword payload indexes filter points before the vector search
- Reuses the existing collection, so no second store is added
Lacks:
- Computes no ingest commit SHA, document class or ADR status
- Holds no generated_from map and no knowledge-base deduplication
- Indexes no hidden .agents/skills folder and prints no hit context
Proposed design
Problem statement
Add the RAG provenance fields and default filters. The work waits on #4884, #4889 and #3917. The RAG points carry no commit, document class, generated_from map or ADR status. A hit cannot become a citation at a SHA, and a superseded ADR looks current. The indexer skips .agents/skills and indexes the knowledge base twice. The change adds the fields, the default exclusions, the skill include and the single tree-copy knowledge base.
Acceptance criteria
Requirement: Point provenance fields
The indexer SHALL write the ingest commit and the document class to the payload of each point.
Scenario: Fixture point provenance
- WHEN A test indexes a fixture repository with a fixed ingest commit.
- THEN Each point payload has that commit in
commitand thedocument_class()value indoc_class.
Requirement: Generated page source
The indexer SHALL write the generated_from source path from the #4889 map to each generated page point.
Scenario: Generated page payload
- WHEN A test indexes a fixture generated page that the feat(docs): generated pages name their source and stay complete #4889 map names.
- THEN The point payload has the source path from the map in
generated_from.
Requirement: ADR status
The indexer SHALL write the ADR status to the adr_status field of each ADR point.
Scenario: Superseded ADR
- WHEN A test indexes a fixture ADR whose frontmatter status is
superseded. - THEN The point payload has
adr_statusequal tosuperseded.
Requirement: Skill file indexing
The indexer SHALL index each .agents/skills/**/SKILL.md file as an explicit include.
Scenario: Hidden skill folder
- WHEN A test indexes a fixture repository with
.agents/skills/example/SKILL.md. - THEN The index contains a point for that
SKILL.mdfile.
Requirement: Default search exclusions
The default brain search SHALL exclude points under openspec/changes, docs/agent/archive and tests/fixtures.
Scenario: Default search filter
- WHEN A test indexes the four paths
openspec/changes/example.md,docs/agent/archive/old.md,tests/fixtures/example.pyanddocs/guide.mdand runs the default search. - THEN The result has the
docs/guide.mdpoint and no point from the three excluded paths.
Requirement: Retriever context fields
The retriever SHALL print commit, doc_class, generated_from and adr_status in the context of a hit.
Scenario: Hit context
- WHEN A test formats a hit with all four fields set.
- THEN The context text contains each field value.
Requirement: Single knowledge-base source
The indexer SHALL index the knowledge base only from the tree copy and keep it in one Qdrant project.
Scenario: Tree-copy-only knowledge base
- WHEN A test indexes a fixture tree copy with a knowledge-base document and a bundled copy of the same document.
- THEN The docs collection has one point for the document, under the tree-copy project.
Requirement: Project-brain spec delta
The change SHALL add an OpenSpec spec delta for the project-brain capability.
Scenario: Spec validation
- WHEN The change folder is validated with
uv run openspec validate --strict. - THEN The command exits 0.
Requirement: RAG documentation
The change SHALL update the RAG text in k8s/README.md and ARCHITECTURE.md.
Scenario: Documentation row
- WHEN The docs row runs with
uv run devops ci --check --only docs. - THEN The docs row passes.
Requirement: Pending a person after the merge
The owner MUST run one reindex after the merge and confirm the knowledge base is in one Qdrant project.
Scenario: One reindex
- WHEN The owner runs one reindex after the merge.
- THEN The docs collection shows one knowledge-base project.
Existing Tool Considered
Qdrant (in-use) covers the storage and filtering of the new payload fields. The alternatives check in the issue body lists what it covers and lacks. The proposal computes commit, doc_class, generated_from, adr_status and default_excluded in the indexer. It indexes .agents/skills/**/SKILL.md, removes the bundled knowledge-base include, and prints the fields in the retriever.
Key questions
- Which existing tool stores and filters the new point fields?: Qdrant is in use. It stores the JSON payload and filters points on the existing collection. The indexer computes the project-specific values, and the retriever prints them. (best practice) [sources: src/devops_cli/ai/rag/indexer.py, src/devops_cli/ai/rag/retriever.py]
- Chosen: Qdrant payload fields and filters. The project already uses Qdrant. It stores and filters the new fields on the existing collection.
- Rejected: Separate metadata database. It adds a second store and a join that the search does not need.
- Rejected: Filter after vector search. It can return fewer results than the requested limit and cannot use the payload index.
- What value goes in the
commitfield?: Use the ingest head SHA thatsrc/devops_cli/ai/rag/ingest.pyrecords for the tree copy. The retriever prints it as the citation commit. (best practice) [sources: src/devops_cli/ai/rag/ingest.py, src/devops_cli/ai/rag/retriever.py]- Chosen: Ingest head SHA. It is the commit of the tree copy that the index reads. A citation can name it.
- Rejected: Current time. It is not a commit and cannot support a citation.
- Rejected: Per-file git log. It adds a git call for each file. The issue names the ingest head.
- How does the indexer get
doc_class?: Calldocument_class()fromsrc/devops_cli/docs/inventory.pyfor each indexed file. Write its value todoc_class. (best practice) [sources: src/devops_cli/docs/inventory.py, src/devops_cli/ai/rag/indexer.py]- Chosen: Reuse
document_class(). It is the project's single document classifier. The issue names it. - Rejected: Duplicate the classifier in the indexer. Two classifiers can disagree and add maintenance.
- Chosen: Reuse
- How does the indexer get
generated_from?: Use the source path that the feat(docs): generated pages name their source and stay complete #4889 map gives for a generated page. Write it togenerated_from; the citation model names the field atsrc/devops_cli/citation.py:63. (best practice) [sources: src/devops_cli/citation.py:63, src/devops_cli/ai/rag/indexer.py]- Chosen: Reuse the feat(docs): generated pages name their source and stay complete #4889 map. The map already names the source of a generated page. The issue names it.
- Rejected: Derive the source from the file path. It duplicates the map and can disagree with it.
- Rejected: Leave
generated_fromout. A generated page needs its source for a citation.
- How does the indexer get
adr_status?: For a file underdocs/adr/, read the status with the ADR parser insrc/devops_cli/roadmap/adr.pyand write it toadr_status. The citation model names the field atsrc/devops_cli/citation.py:64. (best practice) [sources: src/devops_cli/roadmap/adr.py, src/devops_cli/citation.py:64]- Chosen: Reuse the ADR parser. It already reads the ADR frontmatter status.
- Rejected: Regex the status in the indexer. It duplicates parsing and misses the roadmap ADR rules.
- Rejected: Leave
adr_statusout. A superseded ADR would look current.
- How should the default search exclude paths?: Set a boolean
default_excludedpayload field in the indexer foropenspec/changes/,docs/agent/archive/andtests/fixtures/. The retriever adds a Qdrantmust_notfilter ondefault_excluded: true. (best practice) [sources: src/devops_cli/ai/rag/indexer.py, src/devops_cli/ai/rag/retriever.py]- Chosen: Payload boolean
default_excluded. The indexer sets it once. The retriever filters exact values before the vector search. - Rejected: Path-prefix filter on
file_path. Qdrant payload filters match exact values, not path prefixes. - Rejected: Post-search filter. It can return fewer results than the limit and wastes the payload index.
- Chosen: Payload boolean
- How should the indexer include
.agents/skills?: Keep the.agentsdirectory in the walk. In_is_indexable_file, allow only.agents/skills/**/SKILL.mdbefore the hidden-path check. (best practice) [sources: src/devops_cli/ai/rag/indexer.py]- Chosen: Explicit skill include. It indexes the named files and keeps other hidden folders out.
- Rejected: Unskip all hidden folders. It indexes
.gitand other hidden state. - Rejected: Copy skills to a visible path. It adds a second copy and a sync step.
- How should the knowledge base stop appearing twice?: Remove the bundled knowledge-base include from
_collect_all_indexing_filesandindex_knowledge_base. Index the tree copy from refactor(ai): drop the knowledge base copies of project docs #3917 only. (best practice) [sources: src/devops_cli/ai/rag/indexer.py, src/devops_cli/ai/kb.py]- Chosen: Tree copy only. It gives one source and one Qdrant project.
- Rejected: Keep both copies. It keeps the duplicate points and two projects.
- Rejected: Deduplicate by content hash. It still writes two projects and adds a merge step.
- How do the tests avoid a live Qdrant and embedder?: Use the fake Qdrant and embedder seams in
tests/ai/rag/test_rag_ingest.py. [sources: tests/ai/rag/test_rag_ingest.py, src/devops_cli/ai/rag/indexer.py] - Should the retriever print the new fields in its context?: Yes. Print
commit,doc_class,generated_fromandadr_statusfor each hit. (best practice) [sources: src/devops_cli/ai/rag/retriever.py]- Chosen: Print the fields in the context. The issue asks for the fields in the retriever context. A citation needs them.
- Rejected: Leave the fields out. A hit cannot become a citation at a SHA without them.
- How does the change validate the spec delta and the RAG docs?: Run
uv run openspec validate --strictfor the change folder. Runuv run devops ci --check --only docsfor the docs row. [sources: openspec/config.yaml, CONTEXT.md]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(ai)scope of the title gives the scope.It improves RAG citation and filtering but does not fix a broken or critical path.Users gain SHA-level citations and filtered search, which improves trust in RAG answers.About 150 lines plus tests across indexer, retriever, and config, plus one reindex run.Both deal with the knowledge base in Qdrant, but the candidate adds payload fields and filters while #1139 fixes re-index triggers and drift reads.devops-cli-service commentedon Nov 15, 2026
Alternatives check: in-use
Reason: The searches show that Qdrant already stores arbitrary JSON payload on each point and filters vector search by payload conditions, which covers the storage and filtering half of this issue on the collection the project already uses. It does not produce the project-specific values (ingest commit,
document_class(), thegenerated_frommap,adr_status), index.agents/skills, or remove the duplicate tree copy, so the indexer and retriever changes remain project code.The repository already uses this tool.
Tool: qdrant/qdrant (https://github.com/qdrant/qdrant)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 16, 2026
Refine cannot set this item to Ready at fccb781 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.