Skip to content

test(ai): a gold set measures retrieval of knowledge base facts #3902

Closed

Description

@dan-petty

Problem

The knowledge base (src/devops_cli/ai/knowledge_base, 75 articles) has no recall test of its own retrieval. The audit of 2026-11-07 found that the embedding benchmark uses the articles as its main corpus, and that the review loop injects matched manuals into group analysis. Nobody can say whether a replacement source answers the same questions as well. 15 of 26 claims that the audit checked were stale, so the old source is not a clean reference either.

Expected

A gold set of questions about tool, library and project facts that the review loop and the jobs ask, each with the source that must answer it (a document, a lock file, a generated reference or a primary web page), and a command that scores any retrieval source on it (hit rate at k and the share of answers that are stale).

Acceptance criteria

  • A test: the gold set loads, each entry names a question and an expected source, and an entry whose expected answer is stale on the checked-in folder is marked.
  • A command or test helper scores a source with a recorded fake of Qdrant and the embedding model (no network in CI).
  • The score of the current folder and of the generated project digest is recorded in the pull request comment.
  • The benchmark corpus is built from docs/ and the index, so a later removal of the folder does not change it silently.

Existing tool considered

The embedding benchmark (src/devops_cli/ai/benchmark) and devops ai rag-query already exist. The change adds the gold set and the scorer on them. No new tool.

Related

Related: the research agent plan of 2026-11-07, #3877, #2432. Blocks the removal of the folder.

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

Proposed design

Problem statement

The bundled knowledge base of 75 manuals grounds the review loop and chat, but no labelled gold set measures whether retrieval answers the questions that the review loop and jobs ask. The audit of 2026-11-07 found 15 of 26 checked claims stale, so the old source is no clean reference. This change adds a checked-in gold set, marks stale entries against the folder and lockfiles, and scores any retrieval source offline with hit rate at k=5 and stale share. The benchmark corpus comes from docs and the generated index so that removing the folder cannot change it silently.

Acceptance criteria

Requirement: Gold set loads and validates

The gold-set loader SHALL load every entry of the checked-in tests/fixtures/kb_gold_set/gold_set.json and reject an entry that lacks a question, an expected source, an expected answer, or a fact type.

Scenario: Incomplete entry is rejected

  • WHEN an entry omits its expected source
  • THEN the loader raises a validation error that names the entry and the missing field.

Requirement: Gold set covers three fact types

The checked-in gold set MUST hold at least one entry for each of the tool, library and project fact types.

Scenario: All three fact types are present

  • WHEN the loader reads the checked-in gold set
  • THEN the set has at least one entry for each of tool, library and project.

Requirement: Stale entries are marked

The loader MUST mark an entry as stale, with a reason, when its expected source is a checked-in path that is absent or no longer contains the expected answer text.

Scenario: Expected answer is gone

  • WHEN an entry's checked-in expected source no longer contains its expected answer
  • THEN the loader returns the entry with stale set to true and a reason that names the source path.

Requirement: Version drift marks an entry stale

The loader MUST mark an entry as stale when its expected source is a knowledge base article that load_matched_kb_manuals reports as drift against uv.lock or tools.lock.

Scenario: Mismatched version marks an entry stale

  • WHEN the expected source's applies_to names a version other than the one the lockfile pins
  • THEN the entry is stale and its reason is the drift reason of that article.

Requirement: Scorer reports hit rate and stale share

The scorer SHALL report hit rate at k=5, from the same ranked list that the benchmark's recall_at_5 uses, and stale share as the number of stale entries divided by all entries.

Scenario: Scorer output holds both measures

  • WHEN the scorer runs on the gold set against one retrieval source
  • THEN the result holds hit_rate_at_5 and stale_share, each a number in [0, 1].

Requirement: Scorer runs offline

The scorer test helper MUST install FakeQdrantClient and FakeEmbedder through the qdrant and embedder fixtures and MUST make no network call.

Scenario: Offline scoring uses the fakes

  • WHEN the helper scores a retrieval source in CI
  • THEN it reads the fake Qdrant and embedding responses and the hermetic floor records no network access.

Requirement: Score block for both sources

The scorer SHALL emit a Markdown score block with one row for the checked-in knowledge base folder and one row for the generated project digest, each with hit rate at k=5 and stale share.

Scenario: Both sources produce a score row

  • WHEN the scorer runs with both built-in source adapters
  • THEN the block has a knowledge_base row and a project_digest row, each giving hit rate at k=5 and stale share.

Requirement: Benchmark corpus from docs and index

The benchmark corpus builder MUST build its corpus from docs/, including the generated docs/KNOWLEDGE_BASE.md index, and the files that WorkspaceIndexer.collect_files returns, and MUST NOT fall back to the knowledge base folder alone.

Scenario: Corpus survives folder removal

  • WHEN the knowledge base folder is absent from a test fixture
  • THEN the builder returns corpus entries from docs/ and the index and raises no error.

Existing Tool Considered

The alternatives check is not-applicable for this test item and made no search. No open, maintained tool covers the labelled knowledge-base gold set and stale-aware scorer. The existing embedding benchmark (src/devops_cli/ai/benchmark) computes recall@1/3/5, MRR and NDCG@5, and devops ai rag query runs SemanticRetriever against live Qdrant. They lack a labelled gold set with an expected source per question, stale marking against the checked-in folder and lockfiles, and a score block over two sources. The rag command also needs a live Qdrant. The change builds the gold set, stale marker and source adapter as a test fixture and a small scorer. Written cost: about 20k to 30k tokens to build, keep and fix the scorer and gold set, and 1 to 2 engineer-days.

Key questions

  • Which retrieval sources must the scorer support?: Two built-in source adapters over SemanticRetriever(qdrant, embedder): the checked-in knowledge base folder, read through get_knowledge_base_dir and list_knowledge_base_articles, and the generated project digest, the corpus built from docs/ plus the files WorkspaceIndexer.collect_files returns. The adapter keeps the scorer independent of Qdrant. (best practice) [sources: src/devops_cli/ai/kb.py:45, src/devops_cli/ai/benchmark/code_chunk_corpus.py:54, src/devops_cli/ai/rag/retriever.py:372]
    • Chosen: Source adapter for folder and digest. The issue asks for both scores, and one adapter over the existing retriever seam keeps the scorer offline-testable with the shared fakes.
    • Rejected: Hard-code the knowledge base folder only. It cannot score the generated digest and would not show corpus drift.
    • Rejected: Call Qdrant directly in tests. It needs network and breaks the offline CI rule of docs/TESTING.md:68.
  • How does the scorer mark a stale expected answer?: The loader marks an entry stale, with a reason, in three cases: its checked-in expected source is absent; the expected answer text is not in the source body; or the expected source is a knowledge base article that load_matched_kb_manuals reports as drift, meaning the article's front-matter applies_to does not match uv.lock/tools.lock, or the front matter is missing or undated. (best practice) [sources: src/devops_cli/ai/kb.py:242, src/devops_cli/ai/kb.py:629, docs/adr/0005-review-findings-come-from-tools-not-models.md:54]
    • Chosen: Presence check plus the existing drift match. It is deterministic and offline, and the drift match is the project's own measure of a manual that no longer applies to the locked versions (ADR 0005).
    • Rejected: Presence check only. A stale version claim stays in the file, so the check would miss the stale claims that the audit found.
    • Rejected: Manual stale flag only. A person can forget to update it and the score would hide drift.
    • Rejected: Model judgement. ADR 0005 keeps findings on tools and checked facts, not model output.
  • Which evaluation code computes hit rate at k?: Reuse the embedding benchmark's rank loop: it already builds the ranked indices per query and reports recall_at_5 as a percentage (embedding_runner.py:486-492, 535). Hit rate at k=5 is that share divided by 100, so the scorer adds only the stale share and no IR evaluation dependency. (best practice) [sources: src/devops_cli/ai/benchmark/embedding_runner.py:428, src/devops_cli/ai/benchmark/embedding_runner.py:486, src/devops_cli/ai/benchmark/embedding_runner.py:535]
    • Chosen: Reuse the benchmark's ranking and recall. The ranked list and recall_at_5 already exist and are tested, so hit rate at k is one division, not new machinery.
    • Rejected: Add ranx or ir_measures. A new dependency for a metric the benchmark already computes adds supply-chain and maintenance cost.
    • Rejected: Add a separate vector database. The issue asks for a scorer, not a new retrieval source.
  • How do CI tests avoid network?: The root qdrant and embedder fixtures install FakeQdrantClient and FakeEmbedder through the Qdrant and embedding seams, which resolve_rag_components and SemanticRetriever take, and the hermetic floor fails a test that reaches network without a fake. (best practice) [sources: docs/TESTING.md:68, docs/TESTING.md:206, docs/adr/0007-tests-double-only-process-edges.md:3]
    • Chosen: In-memory fakes injected through the seams. It keeps the test deterministic and offline, and the fakes already serve the indexer and the RAG commands.
    • Rejected: Live Qdrant and embedding service. CI has no network and results would be nondeterministic.
    • Rejected: Skip the scorer in CI. It would leave the new scorer untested.
  • Where does the benchmark corpus come from?: From docs/, which includes the generated docs/KNOWLEDGE_BASE.md index that devops docs generate writes, and from the files that WorkspaceIndexer.collect_files returns. The knowledge base folder may be added when it exists, but it is never the only source: the fallback that reads only the knowledge base articles (document_chunker.py:508-516) goes. (best practice) [sources: src/devops_cli/ai/benchmark/document_chunker.py:467, src/devops_cli/ai/benchmark/document_chunker.py:508, src/devops_cli/docs/generator.py:1369, src/devops_cli/config/constants.py:480, src/devops_cli/ai/benchmark/code_chunk_corpus.py:54]
    • Chosen: Build from docs and the generated index. The generated index is checked in and regenerated by devops docs generate, so the corpus survives a removal of the folder and still shows what changed in docs.
    • Rejected: Build from the knowledge base folder. The issue plans to remove the folder and the corpus would drift with it.
    • Rejected: Freeze a corpus snapshot. It hides changes in docs and the index.
  • Which k does hit rate use?: k=5, the default of ai.rag.top_k that the review loop injects and the depth of the benchmark's NDCG@5. The scorer takes k as a parameter, and the score block reports k=5. (best practice) [sources: src/devops_cli/config/defaults.py:235, src/devops_cli/ai/benchmark/embedding_runner.py:69, src/devops_cli/ai/benchmark/embedding_runner.py:466, src/devops_cli/ai/rag/retriever.py:385]
    • Chosen: k=5. It is the number of results the review loop injects and the depth the benchmark already scores, so the measure matches how the retrieved text is used.
    • Rejected: k=1 only. It hides near misses at the depth the loop uses.
    • Rejected: k=20. It exceeds the context that the review loop injects.
  • What format does the gold set use?: A checked-in JSON file, tests/fixtures/kb_gold_set/gold_set.json, with one object per entry holding the question, the expected source, the expected answer and the fact type. It follows the project's labelled recall set, which keeps the same kind of expected evidence per row as JSON under tests/fixtures/. (best practice) [sources: tests/fixtures/review_recall/recall_set.json:1, docs/SELF_IMPROVEMENT.md:994, docs/TESTING.md:95]
    • Chosen: JSON under tests/fixtures/. The project's labelled recall set and the other fixture data are JSON under tests/fixtures/, which a test finds through tests.support.paths.FIXTURES.
    • Rejected: YAML under tests/fixtures/. YAML front matter belongs to knowledge base manuals; the labelled test data of this repository is JSON.
    • Rejected: Markdown task prompt. src/devops_cli/ai/tasks/ holds prompts and benchmark prompt text, not labelled test data with a per-row expected source.
    • Rejected: Database table. It needs a running service and breaks offline tests.
  • How is the score of the current folder and the generated digest recorded in the pull request comment?: The implement job runs the scorer in the devcontainer against the live Qdrant and embedding model and writes the Markdown score block into the pull request body. CI checks only the offline scorer with the fakes, so the recorded number comes from a run that the job makes. (best practice) [sources: docs/TESTING.md:68, src/devops_cli/commands/rag.py:359]
    • Chosen: Implement job records the live block. It keeps CI offline and puts the live number in the pull request body.
    • Rejected: CI runs the live scorer. CI has no network and no live Qdrant.
    • Rejected: Omit the live score. The issue asks for the score of both sources in the pull request comment.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/test
    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/test. The test prefix of the title gives the type.
    • Scope: scope/ai. The (ai) scope of the title gives the scope.
    • Priority: P2-Medium. The audit found 15 of 26 claims stale, but this item adds a measurement tool rather than fixing the content.
    • Value: Medium. It enables any team to verify that a retrieval source answers the same questions before replacing the knowledge base.
    • Effort: Medium. It requires a gold set, a scorer command, a recorded fake for Qdrant and the embedding model, and PR comment integration.
    • Related: feat(ai): model-in-the-loop prompt benchmarking #413, which asks for a different change. Both measure AI quality, but #413 scores prompt output through a model while the candidate scores retrieval recall against a gold set.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at b659660 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • How is the score of the current folder and the generated digest recorded in the pull request comment? (a person decides)
  5. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

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

    Tool: none found

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

  6. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Scope from the embedding serving study (2026-11-11)

    This issue is child 1 of #4961, the tracker of embedding and reranking serving for retrieval. The new scope adds a project eval set, rank metrics and a paired comparison of two runs.

    Why

    No end-to-end retrieval eval exists in the project. The only saved quality numbers use synthetic path-and-symbol queries (the embedding benchmark of 2026-10-22). The study built a 62-query set from the project: 24 issue fixes, 18 census questions and 20 exact identifiers, with 119 relevant files at corpus commit 9208717. The candidates came from git commits and a search of the corpus for identifiers, not from a retrieval arm. The set showed that the current path (nDCG@10 0.386) is worse than dense search only (0.468, p 0.036). Each later retrieval change of #4961 needs the same measurement. This issue already asks for a command that scores any retrieval source.

    New scope

    1. Check in the 62-query set as a second gold set beside the knowledge base set, pinned to its corpus commit. Each query names its kind and its relevant files with a grade. The study keeps the set (evalset.json) and the run files (run-<arm>.json) in the agent data directory of the workstation that ran it.
    2. Add one scorer for both sets: file-level recall@5, recall@10, MRR@10 and nDCG@10, for all queries, for each kind, and for the natural-language queries (issue_fix and census). Use pytrec_eval (the library of refactor(ai): rank the benchmark with numpy and pytrec-eval #1928).
    3. Add a paired comparison of two run files. The interval comes from scipy.stats.bootstrap (paired samples, 10,000 samples, fixed seed). The p value comes from a paired sign-flip test (scipy.stats.permutation_test with permutation_type="samples"). A run file holds the top 100 chunk ids for each query.
    4. Build the eval index from the pinned corpus into a temporary Qdrant collection, and delete it after the run. The embedding cache makes a second run cheap.
    5. Run the arms through the production seams (EmbeddingsEngine, the Qdrant query, the rerank call), not through study scripts.
    6. Add at least 15 natural-language questions about code behaviour as their own kind. The set is docs-heavy today (69% docs chunks, against about 51% in production), and one third of its queries are identifiers. A change of reranker or embedder, and any claim of child 6 beyond exact identifiers, needs this kind.

    Acceptance added

    • The acceptance of this issue stays.
    • The B0 and B2 run files of the study are checked in as fixtures. The scorer gives B0 nDCG@10 0.386 and B2 0.567 on them (within 0.001).
    • The paired comparison of B2 and B0 gives +0.181, with a 95% interval that does not include 0.
    • A CI test scores a recorded run with no network.
    • The report gives the score of the code-behaviour kind apart from the other kinds.
    • git grep finds no hand-written nDCG or MRR function.

    Depends on: #1928, and the dependencies that this issue already names.

  7. added
    status/ready
    and removed
    status/new
    on Nov 13, 2026
  8. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at b4a4ffb (see proposed design in issue body).

    Moved to new items: #5496.

  9. 19 remaining items

  10. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Stopped at fix.

    Failed check: Semantic PR title. The end of its log:

    pe Ships No Runtime Code\t2026-11-17T14:57:42.9623186Z ^[[36;1muv run python -m devops_cli.github.release_title --title "$PR_TITLE" --files "$RUNNER_TEMP/files.txt"^[[0m
    Semantic PR title\tCheck that a Hidden Type Ships No Runtime Code\t2026-11-17T14:57:42.9653127Z shell: /usr/bin/bash -e {0}
    Semantic PR title\tCheck that a Hidden Type Ships No Runtime Code\t2026-11-17T14:57:42.9653596Z env:
    Semantic PR title\tCheck that a Hidden Type Ships No Runtime Code\t2026-11-17T14:57:42.9653909Z   UV_MANAGED_PYTHON: 1
    Semantic PR title\tCheck that a Hidden Type Ships No Runtime Code\t2026-11-17T14:57:42.9654308Z   UV_PYTHON_INSTALL_DIR: /home/runner/work/_temp/uv-python-dir
    Semantic PR title\tCheck that a Hidden Type Ships No Runtime Code\t2026-11-17T14:57:42.9654780Z   UV_PYTHON: 3.14
    Semantic PR title\tCheck that a Hidden Type Ships No Runtime Code\t2026-11-17T14:57:42.9655147Z   UV_CACHE_DIR: /home/runner/work/_temp/setup-uv-cache
    Semantic PR title\tCheck that a Hidden Type Ships No Runtime Code\t2026-11-17T14:57:42.9657707Z   GH_TOKEN: ***
    Semantic PR title\tCheck that a Hidden Type Ships No Runtime Code\t2026-11-17T14:57:42.9658054Z   PR_TITLE: test(ai): Score retrieval with KB gold set
    Semantic PR title\tCheck that a Hidden Type Ships No Runtime Code\t2026-11-17T14:57:42.9658485Z   PR_NUMBER: 6169
    Semantic PR title\tCheck that a Hidden Type Ships No Runtime Code\t2026-11-17T14:57:42.9658816Z ##[endgroup]
    Semantic PR title\tCheck that a Hidden Type Ships No Runtime Code\t2026-11-17T14:57:43.7754018Z ##[error]The title type `test` is hidden in release-please-config.json, so it ships no release, but this pull request changes runtime code: `src/devops_cli/ai/benchmark/document_chunker.py`, `src/devops_cli/ai/benchmark/gold_set.py`, `src/devops_cli/ai/benchmark/gold_set_scorer.py`. Use one of `feat`, `fix`, `perf`, `refactor`, `revert`.
    Semantic PR title\tCheck that a Hidden Type Ships No Runtime Code\t2026-11-17T14:57:43.8128722Z ##[error]Process completed with exit code 1.
    

    Failure class: outside_plan.
    Action taken: none.
    Action left: wait: wait for a person.

    Step Status Attempts Tokens in/out Last failing command
    group 1 done 2 5365970/34288 pytest on base: tests/ai/benchmark/test_kb_gold_set.py
    group 2 done 1 6697468/48696 pytest on base: tests/ai/benchmark/test_embedding_benchmark.py
    group 3 done 1 4593422/32841 pytest on base: tests/ai/benchmark/test_gold_set_scorer.py
    group 4 done 1 2086118/9674 -
    fix stopped 1 9518444/38245 Semantic PR title

    Reason:

    The fix step changed paths that the plan does not name: `docs/roadmap/implement.md`, `src/devops_cli/roadmap/implement/implement_run.py`, `src/devops_cli/roadmap/steps/open.py`, `tests/roadmap/implement/test_roadmap_implement_job.py`. A fix step may change only the paths that the plan names and the files of the change folder. The cause of the failed check may lie in another path. A person decides how to change the plan.
    

    Last message of the agent (a claim that no check verified): I fixed the cause of the failing Semantic PR title check. Cause: devops roadmap implement retitles the draft pull request when it opens it (steps/open.py applies release_title.shipping_title), but the final metadata write in _delivery_metadata used _delivery_title() unchanged. That write put the item's hidden type back over the branch: this item's title is test(ai): … while the branch adds src/devops_cli/ai/benchmark/gold_set.py and gold_set_scorer.py, so the check refused it. Changes - src/devops_cli/roadmap/implement/implement_run.py: _delivery_title now passes its title through a new _shipping_title, which reads the release config from the default branch (shared release_config), and only for a hidden type reads the local diff (list_changed_files over origin/<default>...HEAD) and applies shipping_title (feat when a runtime file is added, else fix). A shown type reads no diff. - src/devops_cli/roadmap/steps/open.py: _release_config(request) became the public release_config(repo, base, store=None), so the open step and the implement job read the config one way. - tests/roadmap/implement/test_roadmap_implement_job.py: new test test_a_hidden_type_of_the_item_gives_way_to_the_type_that_ships_runtime_code — an item titled test(roadmap): …, a config that hides test, and a branch that adds a module; the PATCH title must be feat(roadmap): …. It failed before the fix and passes after. - docs/roadmap/implement.md: step 6 no

    The job discarded this work. Read it before you retry:

    diff --git a/docs/roadmap/implement.md b/docs/roadmap/implement.md
    index de1f9372c..8124908d2 100644
    --- a/docs/roadmap/implement.md
    +++ b/docs/roadmap/implement.md
    @@ -71,7 +71,7 @@ For each item, the job does these things in order:
     3. It regenerates the documentation and archives the change, when the toolchain preset of `.devops/roadmap.toml` on the default branch declares them (#4635). The Job reads the file from the default branch, so an edit of the checkout adds or removes no step and changes no check. A default branch with no file gets the `neutral` preset. A step that the Job skips has a line in its comment on the pull request. devops-cli declares `toolchain = "devops-cli"`.
     4. It runs the scoped checks: the pre-push stage of the hooks, the `devops ci` rows `constructs`, `docs` and `openspec`, the tests that cover the changed files, and the strength check of the new tests (#3051). The strength check measures the quality of the new tests in three parts: the assertion scan of the new test files (`test-function-has-assertion`), the bounded mutation run with scoped test targets, and the coverage delta of the changed files with diff-cover at 90%. The mutation run is bounded by `roadmap.implement.command_timeout_seconds` and at most `CONST_ROADMAP_IMPLEMENT_SCOPED_TEST_MODULES` source files, and mutmut's stats collection is scoped to the test modules: for the run, the job adds them to `pytest_add_cli_args_test_selection` of `[tool.mutmut]` in `pyproject.toml`, because `mutmut run` takes no pytest argument and the process runner refuses the key `PYTEST_ADDOPTS` (#5887). For the run, the job also sets `only_mutate` to the files of the targets, so mutmut writes no mutated copy of the other source files into `mutants/` (723 MB for all of `src/devops_cli`, 68 MB for one target, #5960). After the run, the file holds its bytes again, and the job removes `mutants/`. A change touching more source files than the bound tests the files up to the bound and names each skipped file. Changed files of a task group of kind `other` are left out of the scan, mutation run, and coverage delta, naming the group as the reason. When no test module covers the change, no coverage check runs and the comment states the reason. The comment on the pull request shows the strength report: surviving mutants with their file, line and name, uncovered changed lines, any bound reached, and any skipped group with its reason. A failed check gets a fix step. A stop here still pushes the commits that passed, and the draft stays a draft.
     5. It pushes.
    -6. It sets the title and the body of the pull request. The title has the type and the declared scope of the title of the issue, and the summary of the plan: the text after `docs(openspec): plan #<issue>` in the subject of the commit that adds the change folder, without the end `(#<pull>)` of a squash merge. That subject is the title of the plan pull request, so the title names the change that the branch makes, and not the goal of the issue. The summary of the title of the issue stands in when that commit has no plan title, or when the form refuses the title with the summary of the plan. The job also writes this title when it opens the draft of a Planned item. The body is one that `build_body` of `pull_form` builds. The body is the Why of the archived proposal, the line `Closes #<issue>`, then the line `Change:` with the archived folder, or the active folder when the project declares no archive step. The job cuts no text. A Why that does not fit in the 1,000 characters, or that holds a closing keyword, gives way to the title of the issue. When the body breaks the form check, the job rebuilds the body one time through the model with the list of problems. It writes the rebuilt body when it passes. A second refusal stops the item at the step `pull request` with the class `refused_reply`, before the job writes the body, so no text with `...`, `…` or a placeholder reaches the pull request. It adds the labels of the new title and removes the labels of the staging title that do not fit. A refused label is a comment on the pull request.
    +6. It sets the title and the body of the pull request. The title has the type and the declared scope of the title of the issue, and the summary of the plan: the text after `docs(openspec): plan #<issue>` in the subject of the commit that adds the change folder, without the end `(#<pull>)` of a squash merge. That subject is the title of the plan pull request, so the title names the change that the branch makes, and not the goal of the issue. The summary of the title of the issue stands in when that commit has no plan title, or when the form refuses the title with the summary of the plan. When `release-please-config.json` hides the type of the title and the branch changes a file under `src/devops_cli/`, the type gives way to `feat`, or to `fix` when the diff adds no runtime file: the check `Semantic PR title` refuses a hidden type for runtime code (#5224). The job also writes this title when it opens the draft of a Planned item. The body is one that `build_body` of `pull_form` builds. The body is the Why of the archived proposal, the line `Closes #<issue>`, then the line `Change:` with the archived folder, or the active folder when the project declares no archive step. The job cuts no text. A Why that does not fit in the 1,000 characters, or that holds a closing keyword, gives way to the title of the issue. When the body breaks the form check, the job rebuilds the body one time through the model with the list of problems. It writes the rebuilt body when it passes. A second refusal stops the item at the step `pull request` with the class `refused_reply`, before the job writes the body, so no text with `...`, `…` or a placeholder reaches the pull request. It adds the labels of the new title and removes the labels of the staging title that do not fit. A refused label is a comment on the pull request.
     7. It watches the checks of the pull request, and runs a fix step for each failed check. The setting `roadmap.implement.repair_rounds` bounds the rounds. A fix step may change only the paths that the plan names and the files of the change folder (the repair scope). A failed check whose log names no path of the repair scope gets no fix step: the job makes no model request, and it stops the item as Blocked with a reason that names the check and the repair scope.
     8. It asks `draft_readiness` and stops with the reason on a refusal, then marks the pull request ready.
     
    diff --git a/src/devops_cli/roadmap/implement/implement_run.py b/src/devops_cli/roadmap/implement/implement_run.py
    index c866a34ef..9328f96b7 100644
    --- a/src/devops_cli/roadmap/implement/implement_run.py
    +++ b/src/devops_cli/roadmap/implement/implement_run.py
    @@ -57,6 +57,7 @@ worktree, which the job removes; the new owner starts from the branch on `origin
     from __future__ import annotations
     
     import json
    +import logging
     import re
     import shutil
     import subprocess
    @@ -102,15 +103,18 @@ from devops_cli.exceptions import (
         ServiceStoppingError,
     )
     from devops_cli.exceptions.roadmap import GitSettingsError, OverWindowError
    +from devops_cli.git.operations import list_changed_files
     from devops_cli.git.worktree_add import add_worktree
     from devops_cli.github.check_verdict import PRCheckItem, read_check_runs
     from devops_cli.github.client import PullRequestFile
    +from devops_cli.github.release_title import ADDED_STATUS, hidden_types, shipping_title
     from devops_cli.github.session import get_github_session
     from devops_cli.lang import MESSAGES
     from devops_cli.openspec.project import uses_openspec
     from devops_cli.output import print_muted
     from devops_cli.roadmap.claim import claimed_by
     from devops_cli.roadmap.clone_git import default_branch, git
    +from devops_cli.roadmap.commit_title import commit_type
     from devops_cli.roadmap.failure import (
         FailureAction,
         FailureClass,
    @@ -213,6 +217,7 @@ from devops_cli.roadmap.status_sync import StatusFacts, write_status
     from devops_cli.roadmap.step_files import TaskGroup, parse_task_groups, section_text
     from devops_cli.roadmap.step_metrics import observe_implement
     from devops_cli.roadmap.steps.comment import Target, post
    +from devops_cli.roadmap.steps.open import release_config
     from devops_cli.roadmap.stores.store import (
         ImplementRecordKey,
         ImplementResult,
    @@ -225,6 +230,8 @@ from devops_cli.security.sanitizer import mask_secrets
     
     _WHY_HEADINGS = frozenset({"why"})
     
    +logger = logging.getLogger(__name__)
    +
     
     # The run id of the comment on the pull request for a run that no Service started (#4070).
     _MANUAL_RUN = "manual"
    @@ -1592,15 +1599,16 @@ class _ItemRun:
             `.github/labels.yml` declares on the default branch and no other (#2800), and the summary
             of the plan, which names the change that the branch makes (#5341). The summary of the
             title of the issue stands in when the item has no plan title, or when the form refuses the
    -        title with the summary of the plan. The check `Semantic PR title` counts the summary in
    -        UTF-16 units, so a long summary stops the item before the job writes a title that the
    -        check refuses (#3292)."""
    +        title with the summary of the plan. The type gives way to one that ships a release when the
    +        branch changes runtime code under a hidden type (`_shipping_title`, #5224). The check
    +        `Semantic PR title` counts the summary in UTF-16 units, so a long summary stops the item
    +        before the job writes a title that the check refuses (#3292)."""
             declared = declared_labels(self.store, ref=None)
             summary = self._plan_summary()
             if summary is not None:
                 title = delivery_title(self.target.item.title, declared, summary)
                 if not title_problems(title, declared):
    -                return title
    +                return self._shipping_title(title)
             title = delivery_title(self.target.item.title, declared)
             problems = title_problems(title, declared)
             if problems:
    @@ -1611,7 +1619,23 @@ class _ItemRun:
                     ),
                     push=False,
                 )
    -        return title
    +        return self._shipping_title(title)
    +
    +    def _shipping_title(self, title: str) -> str:
    +        """`title` with a type that ships a release when the branch changes runtime code under a
    +        hidden type (#5224): `feat` when the diff adds a runtime file, else `fix`. The config comes
    +        from the default branch, as the check reads it, and the diff from the checkout, which holds
    +        every commit of the branch. A shown type reads no diff."""
    +        config = release_config(self.repo, self.default, self.store)
    +        if commit_type(title) not in hidden_types(config):
    +            return title
    +        changed = list_changed_files(self.path, f"origin/{self.default}", "HEAD")
    +        paths = [change.path for change in changed]
    +        added = [change.path for change in changed if change.change_type == ADDED_STATUS]
    +        shipped = shipping_title(title, paths, added, config)
    +        if shipped != title:
    +            logger.info(MESSAGES.roadmap.open_title_retyped, self.branch, title, shipped)
    +        return shipped
     
         def _archived_name(self) -> str:
             """The folder `openspec archive` made for the change: `<date>-<issue>-<slug>`."""
    diff --git a/src/devops_cli/roadmap/steps/open.py b/src/devops_cli/roadmap/steps/open.py
    index 3702886b1..6ed32cacc 100644
    --- a/src/devops_cli/roadmap/steps/open.py
    +++ b/src/devops_cli/roadmap/steps/open.py
    @@ -211,16 +211,15 @@ def _declared(request: OpenRequest) -> tuple[str, ...] | None:
             ) from exc
     
     
    -def _release_config(request: OpenRequest) -> dict[str, Any]:
    -    """The release-please config on the base branch, or an empty config when the repository has
    -    none: a repository with no release-please hides no type. Another failed read raises."""
    +def release_config(repo: str, base: str, store: RoadmapStore | None = None) -> dict[str, Any]:
    +    """The release-please config on `base` of `repo`, or an empty config when the repository has
    +    none: a repository with no release-please hides no type. `store` answers the read when the
    +    caller holds one, and the GitHub session answers it otherwise. Another failed read raises."""
         try:
    -        if request.store is not None:
    -            text: str | None = request.store.repository_file(RELEASE_CONFIG_PATH, ref=request.base)
    +        if store is not None:
    +            text: str | None = store.repository_file(RELEASE_CONFIG_PATH, ref=base)
             else:
    -            text = get_github_session().client.get_file_at(
    -                request.repo, RELEASE_CONFIG_PATH, request.base
    -            )
    +            text = get_github_session().client.get_file_at(repo, RELEASE_CONFIG_PATH, base)
         except GitHubFileNotFoundError:
             return {}
         if text is None:
    @@ -258,7 +257,9 @@ def checked_request(request: OpenRequest, declared: tuple[str, ...] | None) -> O
         code, and no scope that `declared` lacks. Any other problem of the title or the body raises
         `RoadmapOpenRefusedError` that names every problem, and the step writes nothing."""
         title = title_with_declared_scope(request.title, declared)
    -    title = _shipping_title(request, title, _release_config(request))
    +    title = _shipping_title(
    +        request, title, release_config(request.repo, request.base, request.store)
    +    )
         issue = request.item or issue_of_branch(request.head)
         problems = [
             *title_problems(title, declared),
    diff --git a/tests/roadmap/implement/test_roadmap_implement_job.py b/tests/roadmap/implement/test_roadmap_implement_job.py
    index 86b385119..902b57dcc 100644
    --- a/tests/roadmap/implement/test_roadmap_implement_job.py
    +++ b/tests/roadmap/implement/test_roadmap_implement_job.py
    @@ -376,6 +376,36 @@ def test_the_title_of_the_pull_request_has_no_scope_that_the_labels_file_lacks(
         assert patched["title"] == "fix: the job drops a comment"
     
     
    +# The release-please config of the repository: `test` is hidden, so its pull request ships no
    +# release (#5224).
    +HIDDEN_TYPE_CONFIG = json.dumps(
    +    {
    +        "changelog-sections": [
    +            {"type": "feat", "section": "Features"},
    +            {"type": "test", "section": "Tests", "hidden": True},
    +        ]
    +    }
    +)
    +
    +
    +def test_a_hidden_type_of_the_item_gives_way_to_the_type_that_ships_runtime_code(
    +    job_world: JobWorld,
    +) -> None:
    +    """The item type `test` is hidden in the release config, and the groups add a module under
    +    `src/devops_cli/`. The final write of the title takes `feat`, which the check
    +    `Semantic PR title` accepts, and not the hidden type of the item (#5224)."""
    +    job_world.store.seed_file("release-please-config.json", HIDDEN_TYPE_CONFIG, ref="main")
    +    issue = job_world.store._roadmap.issues[1]
    +    job_world.store._roadmap.issues[1] = issue.model_copy(
    +        update={"title": "test(roadmap): the job drops a comment"}
    +    )
    +
    +    job_world.run(two_groups())
    +
    +    (patched,) = job_world.sent("PATCH", f"pulls/{PULL}")
    +    assert patched["title"] == "feat(roadmap): the job drops a comment"
    +
    +
     PLAN_SUMMARY = "Keep the last comment of a thread"
     
     

    The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

  11. added
    status/blocked
    and removed
    status/in-progress
    on Nov 17, 2026
  12. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-implement-devops-cli-3902-d9a708 ended: succeeded.
    Image digest: sha256:72980282a7992be6442688013dcca3927057a3178cba193981bcc5810703e19a

    The last lines of its log:

    Tool call: run_command, started: git grep -n title -- docs/roadmap/implement.md ...
    Tool call: run_command, program git, ok.
    Tool call: read_file, ok.
    Tool call: edit_file, ok.
    Tool call: run_command, started: uv run devops ci docs
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: uv run ruff check src/devops_cli/roadmap/implement/implement_run.py src/devops_cli/roadmap/steps/open.py ...
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: uv run mypy --strict src/devops_cli/roadmap/implement/implement_run.py src/devops_cli/roadmap/steps/open.py
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: git diff --name-only origin/main...HEAD > .data/agent/scratch/files.txt
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: uv run python -m devops_cli.github.release_title --title ...
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: uv run python -m devops_cli.github.release_title --title ...
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: git diff --stat
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: git diff
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: uv run devops ci constructs
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: uv run devops ci openspec
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: git ls-files tests/commands | grep -i ...
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: uv run devops ci test tests/commands/test_roadmap_step_open.py
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: git grep -rn <masked> -- src ...
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: uv run devops ci test tests/roadmap/implement/test_roadmap_implement_body_retry.py
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: git status --short
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: git diff --stat origin/main...HEAD
    Tool call: run_command, program git, ok.
    Disk use of the home volume at the end of step Make check Semantic PR title pass: 2.0 GB. Largest folders: worktree/.venv 1.5 GB, .data 223.7 MB, worktree/.mypy_cache 115.8 MB, worktree/openspec 59.7 MB, .cache 51.9 MB, worktree/tests 35.0 MB, worktree/src 32.7 MB, worktree/.ruff_cache 14.6 MB.
    Disk use of the home volume at the end of step fix: 2.0 GB. Largest folders: worktree/.venv 1.5 GB, .data 223.7 MB, worktree/.mypy_cache 115.8 MB, worktree/openspec 59.7 MB, .cache 51.9 MB, worktree/tests 35.0 MB, worktree/src 32.7 MB, worktree/.ruff_cache 14.6 MB.
    Failure class outside_plan. Action left: wait.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    
  13. removed
    owner/service
    on Nov 17, 2026
  14. added
    status/in-review
    and removed
    status/blocked
    on Nov 18, 2026
  15. removed
    status/in-review
    on Nov 18, 2026
  16. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor
  17. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-18 13:25 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/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions