Repository navigation
feat(ai): Score retrieval with KB gold set - #6169
Conversation
e7bb6e5 to
46b14b8
Compare
8f0186e to
34a4298
Compare
|
The steps of the job: Stopped at fix. Failed check: Failure class:
Reason: Last message of the agent (a claim that no check verified): I fixed the cause of the failing 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
|
34a4298 to
90b6b10
Compare
🤖 I have created a release *beep* *boop* --- ## [0.176.0](v0.175.0...v0.176.0) (2026-11-18) ### Features * **ai:** Score retrieval with KB gold set ([#6169](#6169)) ([06f8e4f](06f8e4f)) ### Bug Fixes * **deps:** update Helm release argo-cd to v10.18.1 ([#6283](#6283)) ([d2407c5](d2407c5)) * **design:** audit the Style Dictionary lock in the gate ([#6265](#6265)) ([c3566da](c3566da)) * **k8s:** Keep the Renovate token away from upgrade tasks ([#6251](#6251)) ([fa261c8](fa261c8)) * **mcp:** bound the GitHub MCP tools longer than a GitHub read ([#6272](#6272)) ([059df0f](059df0f)) * **roadmap:** Isolate the review window git transcript from the host ([#6282](#6282)) ([4b14315](4b14315)) * **roadmap:** Label other job comments in the alternatives request ([#6264](#6264)) ([917ad07](917ad07)) * **roadmap:** preserve stage plan kind on pr collision ([#6288](#6288)) ([8859a9b](8859a9b)) * **security:** Judge KSV-0014 with a dated ignore entry ([#6286](#6286)) ([07240a1](07240a1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
The bundled knowledge base of 75 manuals grounds the review loop and the AI commands, and no labelled set measures whether retrieval answers the questions those jobs ask (#3902). The audit of 2026-11-07 found 15 of 26 checked claims stale, so the old source is no clean reference, and nobody can say whether a replacement source answers the same questions as well. The change adds a gold set, a stale marker that runs against the checked-in sources, and an offline scorer, and it moves the benchmark corpus and its domain vocabulary to docs and the generated index, so a later removal of the folder changes neither.
Closes #3902
Change:
openspec/changes/archive/2026-11-17-3902-a-gold-set-measures-retrieval-of/