Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/roadmap/refine.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The Dependencies section of the body names an issue as `#N` or by its quoted tit
- A block that names an issue that merges in either order (`No merge order`, `Rebase before the second of the two merges`) names no blocker.
- A `#N` in parentheses with other words is a note and names no blocker, and `(#N)` alone names one. So the hold line `- #6521 (hold: ... of #6519)` names the hold issue #6521 and not the tracker #6519.

The narrower rule, and the end of the section at the marker of a job block (#6613), remove false dependencies, so they set a new version of the rules. The cycle check on the new proposal and the end of a stale cycle wait (#6515) set the current version (`CONST_ROADMAP_REFINE_RULES_SINCE`, 2026-11-25T08:15:00Z). An item that waits on a person or on an open blocker under the older rule, such as an item in a dependency cycle or blocked by a false dependency, gets one new look under the current rule (#4795, #6523). If a real dependency remains open under the current rule, the item stays blocked.
The narrower rule, the end of the section at the marker of a job block (#6613), the cycle check on the new proposal and the end of a stale cycle wait (#6515) remove false dependencies and stale waits, and post-merge merge timing, merge ownership, and post-release live-proof checks convert to a `Pending a person after the merge` criterion rather than holding items on `person` (#6445). They set the current rules version (`CONST_ROADMAP_REFINE_RULES_SINCE`, `2026-11-25T09:05:00Z`). An item that waits on a person or on an open blocker under the older rule, such as an item in a dependency cycle or blocked by a false dependency, gets one new look under the current rule (#4795, #6523). If a real dependency remains open under the current rule, the item stays blocked.

Refine adds each issue that the body names by title to the dependencies of the proposal: the one open item with that exact title, else the one closed item with it. Quoted text that is no Conventional Commit title names no issue, and a list item that names `#N` names its issue by the number.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-11-25
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Design

## Decisions
- Use a deterministic text predicate `_is_post_merge_person_question(question)` in `src/devops_cli/roadmap/refine/refine.py` inside `validate_proposal`:
- Matches a merge-act question asking `who` or `when` merges (or approves/accepts and merges) naming `pull request`, `pr`, `record`, `adr`, `change`, or `draft`.
- Matches a post-release check question asking `who` runs, confirms, proves, verifies, or checks a `live proof`, `live keys`, `live check`, `proof`, or `check` after the merge or release.
- Excludes pre-build questions naming `secret`, `repository setting`, or `host` (for example, `"Which repository setting enables the merge?"`).
- Convert matched `person` questions into one deduplicated `AcceptanceCriterion` with `name="Pending a person after the merge"`, omit them from `open_questions` and `validated_qa`, and keep `qa.body_question` in `named`.
- Bump `CONST_ROADMAP_REFINE_RULES_SINCE` to `2026-11-25T09:05:00Z` and keep the `Pending a person after the merge` prompt note outside the `person`-kind definition sentence in `roadmap_refine_reply.md`.

## Rejected alternatives
- Relying on a new `after_merge` boolean field or prompt edits alone: models can still emit `kind="person"` for merge or post-release check questions, so deterministic validation is required.
- Dropping every `person` question: pre-build `person` decisions on secrets, repository settings, and hosts still change the plan and must hold the item.
- Leaving post-merge checks out completely: owner decision `#4780` preserves them as `Pending a person after the merge` criteria rather than losing them.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Proposal: #6445

## Why
Refine turns post-merge timing, merge ownership, and post-release live-proof checks into `person` key questions, leaving items stuck in `New` (`refine.next_step = person`) even though an agent never merges a PR and post-merge or post-release steps do not alter the pre-build design.

## What Changes
- Remove `a merge` from the `person` decision list in `src/devops_cli/ai/tasks/roadmap_refine_reply.md` and direct post-merge / post-release live-proof checks to an acceptance criterion named `Pending a person after the merge`.
- In `src/devops_cli/roadmap/refine/refine.py` (`validate_proposal`), convert any `person` question that asks when/who merges a pull request, record, ADR, change, or draft — or who runs or confirms a live proof or check after the merge or release — into the acceptance criterion `Pending a person after the merge` with no open question, while keeping pre-build `person` questions (such as a secret, repository setting, or host) open.
- Bump `CONST_ROADMAP_REFINE_RULES_SINCE` in `src/devops_cli/config/constants.py` and document the new rules date in `docs/roadmap/refine.md`.
- Update `tests/roadmap/refine/test_roadmap_refine_proposal.py`, `tests/roadmap/refine/test_roadmap_refine_person_wait.py`, and OpenSpec `roadmap-refine/proposal`.

## Capabilities

### Modified Capabilities
- `roadmap-refine/proposal`: remove `a merge` from the `person` list in `roadmap_refine_reply.md`, instruct writing post-merge steps as `Pending a person after the merge`, convert post-merge merge and post-release live-proof `person` questions deterministically in `validate_proposal`, keep pre-build `person` questions open, and advance `CONST_ROADMAP_REFINE_RULES_SINCE`.

## Impact
- `src/devops_cli/ai/tasks/roadmap_refine_reply.md`
- `src/devops_cli/roadmap/refine/refine.py`
- `src/devops_cli/config/constants.py`
- `docs/roadmap/refine.md`
- `tests/roadmap/refine/test_roadmap_refine_proposal.py`, `tests/roadmap/refine/test_roadmap_refine_person_wait.py`

## Feasibility
Confirmed on `origin/main`: `roadmap_refine_reply.md:9` lists `a merge` under `person`, `validate_proposal` (`refine.py:1663-1665`) leaves every `person` question open, `stage_criteria.py:38` handles `pending-person`, and `CONST_ROADMAP_REFINE_RULES_SINCE` (`constants.py:3659`) re-triggers older person waits.

## Existing Tool Considered
The alternatives check of 2026-11-19 recorded `none`. No external library maps this repository's `person` question vocabulary to `Pending a person after the merge`; cost is about 40k tokens and half a day to build.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## MODIFIED Requirements

### Requirement: Only a person's decision waits on a person
A pre-build question of kind `person` SHALL be an open question with "(a person decides)", and the item SHALL wait on a person. Post-merge merge questions and post-release live-proof questions SHALL become no open question, and an open question with no "(a person decides)" mark SHALL NOT wait on a person.

#### Scenario: A decision that AGENTS.md reserves for a person
- **WHEN** the proposal asks "Which repository secret holds the key?" as a `person` question and the proposal passes its form check
- **THEN** the item waits on a person, the Open questions of its refine section hold "Which repository secret holds the key? (a person decides)", and the comment names Open questions

### Requirement: Refine limits person questions to owner-only acts
The refine reply prompt `src/devops_cli/ai/tasks/roadmap_refine_reply.md` SHALL list `a secret, a repository setting or a host` as `person`-kind decisions, SHALL contain no merge word in the `person`-kind sentence or `a review verdict`/`a milestone`, and SHALL name `Pending a person after the merge`.

#### Scenario: Refine reply prompt restricts person questions to owner-only decisions
- **WHEN** a test reads `src/devops_cli/ai/tasks/roadmap_refine_reply.md`
- **THEN** the `person` sentence contains `a secret, a repository setting or a host` with no `merge`, `a review verdict`, or `a milestone`, and the prompt contains `Pending a person after the merge`

## ADDED Requirements

### Requirement: A post-merge question converts to a pending-person criterion
`validate_proposal` MUST convert a `person` question asking who or when merges the pull request, record, ADR, change, or draft — or who runs or confirms a live proof after delivery — into an acceptance criterion named `Pending a person after the merge` with no open question.

#### Scenario: Merge and post-release live-proof questions leave no open question
- **WHEN** scripted proposals ask "Who merges the pull request?", "When does the pull request merge?", or "Who confirms the live proof after the merge and the release?" as `person` questions
- **THEN** `validate_proposal` returns no open question, adds one criterion named `Pending a person after the merge`, `check_ready` returns true, and `next_step_of` returns `ready`

### Requirement: Pre-build person questions still wait
`validate_proposal` MUST keep a `person` question open when its answer changes the pre-build plan, including a secret, a host, or a repository setting even if the question mentions merging.

#### Scenario: Pre-build person questions hold the item
- **WHEN** a proposal asks "Which secret holds the deploy key?", "Which repository setting enables the merge?", and "Which host runs the deploy?" as `person` questions
- **THEN** all three stay in `open_questions`, `check_ready` returns false, and `next_step_of` returns `person`

### Requirement: The refine rules date advances for post-merge handling
`CONST_ROADMAP_REFINE_RULES_SINCE` MUST be later than 2026-11-21 so existing waits created before this rule change are re-evaluated.

#### Scenario: The constant is later than 2026-11-21
- **WHEN** a test reads `CONST_ROADMAP_REFINE_RULES_SINCE` from `src/devops_cli/config/constants.py`
- **THEN** its timestamp is strictly greater than `2026-11-21T13:02:06Z`
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Tasks

## 1. Behavior (RED -> GREEN)

- [x] 1.1 Add failing tests in `tests/roadmap/refine/test_roadmap_refine_person_wait.py` and update `tests/roadmap/refine/test_roadmap_refine_proposal.py` for merge questions, post-release live-proof questions, pre-build person questions, `roadmap_refine_reply.md` wording, and `CONST_ROADMAP_REFINE_RULES_SINCE`.
- Verification: `$ uv run devops ci test tests/roadmap/refine/test_roadmap_refine_person_wait.py tests/roadmap/refine/test_roadmap_refine_proposal.py`
- [x] 1.2 Update `src/devops_cli/ai/tasks/roadmap_refine_reply.md`, `src/devops_cli/roadmap/refine/refine.py` (`validate_proposal`), and `src/devops_cli/config/constants.py` (`CONST_ROADMAP_REFINE_RULES_SINCE`).
- Verification: `$ uv run devops ci test tests/roadmap/refine/test_roadmap_refine_person_wait.py tests/roadmap/refine/test_roadmap_refine_proposal.py`

## 2. Documents

- [x] 2.1 Update `docs/roadmap/refine.md` and run `devops ci docs`, `devops ci fail-to-pass`, and static CI gates.
- Verification: `$ uv run devops ci docs`
27 changes: 24 additions & 3 deletions openspec/specs/roadmap-refine/proposal/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A decision SHALL list the options it compared, each with the reason it was chose
- **THEN** its answer is "Use the library. (best practice)"

### Requirement: Only a person's decision waits on a person
A question of kind `person` SHALL be an open question with "(a person decides)", and the item SHALL wait on a person. An open question with no such mark SHALL NOT make an item wait on a person.
A pre-build question of kind `person` SHALL be an open question with "(a person decides)", and the item SHALL wait on a person. Post-merge merge questions and post-release live-proof questions SHALL become no open question, and an open question with no "(a person decides)" mark SHALL NOT wait on a person.

#### Scenario: A decision that AGENTS.md reserves for a person
- **WHEN** the proposal asks "Which repository secret holds the key?" as a `person` question and the proposal passes its form check
Expand Down Expand Up @@ -218,8 +218,29 @@ The refine code MUST NOT cut the text of a failure or of the review findings wit
- **THEN** it finds neither `CONST_ROADMAP_REFINE_FAILURE_MAX_CHARS` nor `CONST_ROADMAP_REFINE_JUDGE_FINDINGS_MAX_CHARS`

### Requirement: Refine limits person questions to owner-only acts
The refine reply prompt `src/devops_cli/ai/tasks/roadmap_refine_reply.md` SHALL limit questions of `kind` `person` to decisions the project reserves for a person (`a merge, a secret, a repository setting or a host`), and SHALL NOT list `a review verdict` or `a milestone` as person-only decisions.
The refine reply prompt `src/devops_cli/ai/tasks/roadmap_refine_reply.md` SHALL list `a secret, a repository setting or a host` as `person`-kind decisions, SHALL contain no merge word in the `person`-kind sentence or `a review verdict`/`a milestone`, and SHALL name `Pending a person after the merge`.

#### Scenario: Refine reply prompt restricts person questions to owner-only decisions
- **WHEN** a test reads `src/devops_cli/ai/tasks/roadmap_refine_reply.md`
- **THEN** it contains `a merge, a secret, a repository setting or a host` and contains neither `a review verdict` nor `a milestone`
- **THEN** the `person` sentence contains `a secret, a repository setting or a host` with no `merge`, `a review verdict`, or `a milestone`, and the prompt contains `Pending a person after the merge`

### Requirement: A post-merge question converts to a pending-person criterion
`validate_proposal` MUST convert a `person` question asking who or when merges the pull request, record, ADR, change, or draft — or who runs or confirms a live proof after delivery — into an acceptance criterion named `Pending a person after the merge` with no open question.

#### Scenario: Merge and post-release live-proof questions leave no open question
- **WHEN** scripted proposals ask "Who merges the pull request?", "When does the pull request merge?", or "Who confirms the live proof after the merge and the release?" as `person` questions
- **THEN** `validate_proposal` returns no open question, adds one criterion named `Pending a person after the merge`, `check_ready` returns true, and `next_step_of` returns `ready`

### Requirement: Pre-build person questions still wait
`validate_proposal` MUST keep a `person` question open when its answer changes the pre-build plan, including a secret, a host, or a repository setting even if the question mentions merging.

#### Scenario: Pre-build person questions hold the item
- **WHEN** a proposal asks "Which secret holds the deploy key?", "Which repository setting enables the merge?", and "Which host runs the deploy?" as `person` questions
- **THEN** all three stay in `open_questions`, `check_ready` returns false, and `next_step_of` returns `person`

### Requirement: The refine rules date advances for post-merge handling
`CONST_ROADMAP_REFINE_RULES_SINCE` MUST be later than 2026-11-21 so existing waits created before this rule change are re-evaluated.

#### Scenario: The constant is later than 2026-11-21
- **WHEN** a test reads `CONST_ROADMAP_REFINE_RULES_SINCE` from `src/devops_cli/config/constants.py`
- **THEN** its timestamp is strictly greater than `2026-11-21T13:02:06Z`
2 changes: 1 addition & 1 deletion src/devops_cli/ai/tasks/roadmap_refine_reply.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The reply has these keys and no other, at the top level or inside any criterion,
- `acceptance_criteria`: a list of objects, one for each requirement of the change, in the shape of an OpenSpec requirement with one scenario. Each object has exactly five keys, all plain text: `name`, a short name of the requirement; `requirement`, one sentence that states it and contains the word SHALL or MUST in capitals; `scenario`, a short name of one case that a test can check offline; `when`, the condition of that case; and `then`, the result that the test asserts. A test checks the source code of the project. A criterion of a manifest, a workflow or a config file names a validator command or a live check as its proof, such as `uv run devops ci --check --only k8s`, `uv run devops ci --check --only actionlint,zizmor` or a live check such as `uv run devops k8s searxng-check`, in its `when` or its `then`, and `then` is the result that the command shows. It never asks for a test that reads the file, because a test asserts no value of a manifest or a config file. A criterion is never a plain string.
- `existing_tool`: the answer to the existing-tool question. Name the open, maintained tool or library that covers the need and what it lacks. When the change builds its own code instead, give the written cost: the tokens to build, keep and fix that code until it matches the tool, and the elapsed time. It is required.
- `key_questions`: a list of objects, each with the keys `question`, `answer`, `kind`, `sources`, `options` and `body_question`.
- `kind` is `fact` for an answer that the repository or a document establishes; `decision` for a design choice; or `person` only for a decision that the project leaves to a person: a merge, a secret, a repository setting or a host. Give your recommendation as the `answer` of a `person` question.
- `kind` is `fact` for an answer that the repository or a document establishes; `decision` for a design choice; or `person` only for a decision whose answer changes the pre-build plan and that the project leaves to a person: a secret, a repository setting or a host. Write a step that a person does at or after delivery, such as merging or a post-release live proof, as an acceptance criterion named `Pending a person after the merge`, not as a `person` question. Give your recommendation as the `answer` of a `person` question.
- `sources` is a list of strings that name where the answer comes from, each a repository path such as `src/app.py` or `src/app.py:12`, or a URL that a web search returned. A `fact` needs at least one source. Never make up a source: refine checks each path and URL.
- `options` is, for a `decision`, each option that you compared, as an object with exactly three keys: `option`, a short name; `chosen`, `true` for the option that the answer takes, else `false`; and `reason`, why you chose or rejected it. It is an empty list for a `fact` or a `person` question.
- `body_question` is the `number` of the body question that the answer answers, or `null`.
Expand Down
8 changes: 5 additions & 3 deletions src/devops_cli/config/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3681,9 +3681,11 @@ class ValkeyCacheError(StrEnum):
# The version of the rules that set the next step of refine: the time from which they hold. A round
# records it as `refine.rules`. A wait on a person that older rules set gets one new round: the
# record holds an older version, or, when it holds none, refine's last comment is older (#4795). A
# change to a rule that sets a next step sets a later time in its pull request. This one decides
# the cycle step from the new proposal and ends a stale cycle wait (#6515).
CONST_ROADMAP_REFINE_RULES_SINCE: Final[datetime] = datetime(2026, 11, 25, 8, 15, 0, tzinfo=UTC)
# change to a rule that sets a next step sets a later time in its pull request. This one converts
# post-merge merge and post-release live-proof questions into a Pending a person after the merge
# criterion (#6445), so existing person waits set before this rule (including #6515) get one new
# round.
CONST_ROADMAP_REFINE_RULES_SINCE: Final[datetime] = datetime(2026, 11, 25, 9, 5, 0, tzinfo=UTC)
# The budget of one item's investigation (#2398): its model requests and tool calls, the calls
# one turn can make (the function tools go when fewer are left), and the lines and characters of
# one tool answer, so the run stays inside the analysis context window. qwen3.8:27b made two
Expand Down
Loading
Loading