Skip to content

refactor(ai): drop the knowledge base copies of project docs #3917

Description

@dan-petty

Problem

src/devops_cli/ai/knowledge_base (75 articles, about 430 KB) is hand maintained and stale: 15 of 26 checked claims were wrong. 73 of 76 files changed in 30 days, mostly one-cell fixes after code changes, and the changes did not keep it correct. 4 articles only repeat a generated page, a standards document, pyproject.toml or uv.lock, and 3 of the 22 living high findings of the content census are flags in such copies (architecture.md line 79, cli_command_reference.md line 93, configuration_and_settings.md line 18). The knowledge base is also in Qdrant two times: the tree ingest and the devops-cli-kb project.

The owner decided on 2026-11-11: "keep reference docs, but update design to accomodate project brain and keeps all content up to date". The knowledge base is a source of the project brain, so the folder stays.

Expected

  1. The tree copy is the one knowledge base source.
  2. devops_cli/cli_command_reference.md, configuration_and_settings.md, architecture.md and python_packages.md are deleted when they only repeat a generated page, a standards document, pyproject.toml or uv.lock. One source holds each fact.
  3. Each remaining article has front matter (reviewed, sources, applies_to). An article that only repeats a document is deleted.
  4. The front matter is required in the whole knowledge base. Today CONST_KB_METADATA_TARGET_SUBDIRS names 3 subfolders.
  5. The devops-cli-kb project is purged from Qdrant.
  6. docs/KNOWLEDGE_BASE.md (by regeneration) and the knowledge base text of docs/SDLC.md are updated.

Acceptance criteria

  • The 4 copy articles are gone, and no reader or test pins them.
  • A test fails when a knowledge base article has no reviewed, sources or applies_to field.
  • The 3 flag findings are gone.
  • The pull request comment lists the choice for each article and the review eval scores, which are not worse.

Existing tool considered

None. The change deletes content and adds a front matter check.

Related

Dependencies

None.

Alternatives check of 2026-11-21: not-applicable.
Class: refactor, no search.
Tool: none found.

Proposed design

Problem statement

The knowledge base under src/devops_cli/ai/knowledge_base holds 4 articles that only repeat a generated page, a standards document, pyproject.toml or uv.lock. The copies drift from their source and cause 3 of the 22 living high findings of the content census. The front matter check covers only 3 subfolders. The owner decision of 2026-11-11 keeps the folder as a source of the project brain, so this change does not delete the folder. It deletes the 4 copies, makes reviewed, sources and applies_to required in the whole knowledge base, and updates docs/KNOWLEDGE_BASE.md and docs/SDLC.md.

Acceptance criteria

Requirement: Copy articles removed

The knowledge base SHALL hold none of the four articles that only repeat another source: devops_cli/cli_command_reference.md, devops_cli/configuration_and_settings.md, devops_cli/architecture.md and devops_cli/python_packages.md.

Scenario: Knowledge base tree after the change

  • WHEN the test lists every Markdown file under src/devops_cli/ai/knowledge_base
  • THEN the list holds none of the four paths

Requirement: No reader or test names a copy article

Each reader and each test of the repository MUST name none of the four removed articles.

Scenario: Search of the source and test trees

  • WHEN the test searches src/ and tests/ for the four article names
  • THEN it finds no match

Requirement: Front matter required in the whole knowledge base

Every article of the knowledge base MUST declare the front matter fields reviewed, sources and applies_to.

Scenario: Article without a front matter field

  • WHEN the metadata check runs on a temporary article that lacks applies_to
  • THEN the check reports that article path and fails

Requirement: Metadata target covers every subfolder

CONST_KB_METADATA_TARGET_SUBDIRS MUST name every subfolder of the knowledge base root.

Scenario: Constant against the tree

  • WHEN the test compares CONST_KB_METADATA_TARGET_SUBDIRS with the subfolders of src/devops_cli/ai/knowledge_base
  • THEN the two sets are equal

Requirement: Knowledge base documentation is current

The change MUST regenerate docs/KNOWLEDGE_BASE.md from its generator and MUST state in docs/SDLC.md that the tree copy is the one knowledge base source.

Scenario: Docs row and docs site build

  • WHEN uv run devops ci --check --only docs and uv run devops docs site build run on the pull request
  • THEN the docs row passes with no difference and the site build passes with no broken link

Existing Tool Considered

The alternatives check of 2026-11-09 in the issue body gives not-applicable for this refactor class and names no tool. No open tool covers the need, and the change builds no new tool: it deletes 4 articles and widens the front matter check that src/devops_cli/ai/kb.py already runs. Written cost of the code that the project keeps: about 15,000 tokens and under one hour, because the constant, the parser and the test already exist and the change adds one subfolder list and one test case.

Key questions

  • Does the owner decision keep the knowledge base folder?: Yes. The owner decided on 2026-11-11 to keep the reference docs and to change the design for the project brain. The knowledge base is the reference corpus of the AI commands, so the folder stays. [sources: CONTEXT.md, docs/adr/0005-review-findings-come-from-tools-not-models.md]
  • Where does the front matter check of the knowledge base live today?: CONST_KB_METADATA_TARGET_SUBDIRS at src/devops_cli/config/constants.py:5621 names 3 subfolders. src/devops_cli/ai/kb.py reads it and parses applies_to at line 184 and sources at line 185. tests/review/test_kb_manuals_metadata.py tests it. [sources: src/devops_cli/config/constants.py:5621, src/devops_cli/ai/kb.py:184, src/devops_cli/ai/kb.py:185, tests/review/test_kb_manuals_metadata.py]
  • How does the front matter become required in the whole knowledge base?: Widen CONST_KB_METADATA_TARGET_SUBDIRS to name every subfolder of the knowledge base root. Keep the one check in src/devops_cli/ai/kb.py and the one test. (best practice) [sources: src/devops_cli/config/constants.py:5621, src/devops_cli/ai/kb.py, tests/review/test_kb_manuals_metadata.py]
    • Chosen: Widen the existing subfolder constant. One list and one test hold the rule, and the parser in src/devops_cli/ai/kb.py already reads the fields.
    • Rejected: Add a second validator for the other subfolders. Two lists hold the same rule and drift apart.
    • Rejected: Add a pre-commit hook over the tree. The CI test already gates the change, and a hook adds a second path that CI does not see.
  • Which source holds the facts that devops_cli/python_packages.md repeats?: pyproject.toml holds the dependency list and uv.lock pins each version, so the article repeats them and the change deletes it. [sources: pyproject.toml, uv.lock]
  • Which documentation pages change?: docs/KNOWLEDGE_BASE.md is a generated page, so its generator writes it and the docs row of Static Analysis refuses a hand edit. docs/SDLC.md holds the knowledge base text that the change updates. [sources: CONTEXT.md, docs/KNOWLEDGE_BASE.md, docs/SDLC.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Moved to new items

#6578, #6579

Activity

  1. added
    source/agent
    type/refactor
    scope/ai
    status/new
    value/medium
    effort/medium
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/refactor. The refactor prefix of the title gives the type.
    • Scope: scope/ai. The (ai) scope of the title gives the scope.
    • Priority: P2-Medium. The deletion is blocked by open prerequisites and does not block other work.
    • Value: Medium. It removes a stale hand-maintained source that misleads users and costs maintenance.
    • Effort: Medium. It requires deleting files, rewriting or removing several tests, and updating docs, CODEOWNERS, and the invariants list.
    • Related: feat(ai): generate the project digest from code at run time #3904, which asks for a different change. Both target the same knowledge base folder; #3904 generates a digest to replace 17 files, while the candidate deletes the whole folder after all replacements land.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: refactor. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-09. A person decides what this means for the item. The check changes no label and closes no issue.

  5. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Scope from the content freshness plan (2026-11-11)

    This issue is child 5 of #4880, the content freshness tracker. The scope and the title change. The new title is "refactor(ai): drop the knowledge base copies of project docs".

    Why

    This issue plans to delete the whole knowledge base folder (75 articles, about 430 KB). The owner decided on 2026-11-11, word for word: "keep reference docs, but update design to accomodate project brain and keeps all content up to date". The knowledge base is a source of the project brain, so a full deletion conflicts with that decision.

    3 of the 22 living high findings of the content census are flags in articles that copy a generated page (architecture.md line 79, cli_command_reference.md line 93, configuration_and_settings.md line 18). The knowledge base is also in Qdrant two times: the tree ingest and the devops-cli-kb project.

    New scope

    1. Keep the tree copy as the one knowledge base source.
    2. Delete devops_cli/cli_command_reference.md, configuration_and_settings.md, architecture.md and python_packages.md when they only repeat a generated page, a standards document, pyproject.toml or uv.lock. One source holds each fact.
    3. Give each remaining article front matter (reviewed, sources, applies_to). The PR deletes an article that only repeats a document.
    4. Make the front matter required in the whole knowledge base. Today CONST_KB_METADATA_TARGET_SUBDIRS names 3 subfolders.
    5. Purge the devops-cli-kb project from Qdrant.
    6. Update docs/KNOWLEDGE_BASE.md (by regeneration) and the knowledge base text of docs/SDLC.md.

    The dependencies on #3902, #3904 and #3916 stay only for the eval scores. No tool applies: the change deletes content.

    Acceptance added

    • The 4 copy articles are gone, and no reader or test pins them.
    • A test fails when a knowledge base article has no reviewed, sources or applies_to field.
    • The 3 flag findings are gone.
    • The PR comment lists the choice for each article and the review eval scores, which are not worse.

    Related

    #4894 fixes the other 19 living high findings and leaves these 3 to this issue. The RAG payload item (child 13 of #4880) reads the knowledge base only from the tree copy.

    Depends on: None.

  6. changed the title [-]refactor(ai): delete the checked-in knowledge base folder[/-] [+]refactor(ai): drop the knowledge base copies of project docs[/+] on Nov 12, 2026
  7. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor

    This item is stuck in refine failed since 2026-11-12, because its new scope is only in a comment and the title. Refine starts again only after a body edit. Move the scope comment of 2026-11-12T02:23Z into the body.

    Evidence (origin/main 0d90de5, 2026-11-19)

    • The record has refine.next_step: failed, refine.tries: 3, refine.failed_check: acceptance_criteria and refine.failure: The reply of the model failed the form check.
    • The issue has no change after 2026-11-12T02:24:33Z, the time of the rename from "delete the checked-in knowledge base folder". Refine writes its record in the body, so it sent no round in the 7 days since then.
    • The body still holds the old scope. Expected says "the folder is deleted", and the first acceptance point says "The folder is gone". The scope comment of 2026-11-12T02:23Z keeps the folder. It deletes only the 4 copy articles, makes front matter required and purges the devops-cli-kb project from Qdrant.
    • In _still_waiting (src/devops_cli/roadmap/refine/refine.py:2555), the step FAILED returns _settled_wait (line 2584, function at line 2483). Only a body edit ends that wait (fix(roadmap): refine makes a person wait only for a decision #3632). A comment and a title change do not. docs/roadmap/refine.md:127 says the same.
    • A body edit starts the count of tries at 1 again (_tries_on, refine.py:2992-2997).

    Effect

    Relation to #6327

    #6327 (open, Ready) names the failed form check and gives the failure to the next round. That fix does not end this wait, because refine sends no request for a failed item until a body edit. So this item needs the body edit in any case.

    Proposed action

    1. Edit the body with the scope comment of 2026-11-12T02:23Z: the 6 steps of "New scope", the 4 points of "Acceptance added", "Related" and "Depends on: None".
    2. Remove the old Expected text and the old acceptance points, which delete the whole folder.
    3. Let refine run again on the new body.
  8. added
    status/ready
    and removed
    status/new
    on Nov 21, 2026
  9. 1 remaining item

  10. added
    owner/service
    on Nov 21, 2026
  11. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Owner question: The inputs of the step of the task group "Record where each removed article's facts live and score the review" hold 75604 tokens, over the budget of 64000 tokens, also after the model split the groups once. Split the group or raise the budget of the step?

    Options

    1. Split the group: A person splits the group and runs the item again.
    2. Raise the budget: A person raises the budget of the step and runs the item again.

    Recommendation: Split the group: the plan check keeps the budget of the step.

    Evidence

  12. removed
    owner/service
    on Nov 21, 2026
  13. dan-petty commented on Nov 24, 2026

    @dan-petty
    OwnerAuthor

    Split the group.

  14. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 25, 2026
  15. removed
    status/in-review
    owner/agent
    on Nov 25, 2026
  16. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-25 06:00 UTC

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/agenttype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions