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
4 changes: 4 additions & 0 deletions docs/roadmap/stage.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ The MCP server publishes no tool for `roadmap eval stage`: the command is no row

The trace gate refuses a Feasibility sentence that claims a read of the run for a path that the plan runs did not see. A read word (`read`, `reads`, `reading`, `ran`, or the tool `read_file`, also in a span `` `read_file path` ``) is a claim of the run when it has no subject (`` Read `x` ``, `the same read`, `` a quick read of `x` ``), when it is a passive or a participle (`` `x` was read ``, `` `x`, read at the base ``), or when its subject names the run or its author (`I`, `we`, `the run`, `the planner`). A verb of a list has the subject of the list, as in `` I listed `src/`, opened `x` and read `y` ``. A read whose subject is other words, such as `this plan`, `group 2`, `the probe` or `it`, says what the plan or the code does, and `read-only` is no read word. The gate judges the path that the read takes: the path of its `` `read_file path` `` span, without the start and end line after the path, as in `` `read_file path 50 215` ``, the path before a participle, the subject of a passive, else the first path of its object, else the last path before it, else the first path of its result. The object ends at `;`, at a comma before a new clause, or at a verb of the result, such as `shows`, and a pronoun at its start, such as `it` or `that file`, makes the read take the path before it. So in "`read_file` on it showed the text `x.py`" the read takes the path before it, not `x.py`. A run saw a path that a tool call took as its argument. A `search_code` or `callers` match shows one line, so a read whose object is a citation of that line, `path:line` or `path:line:text`, counts as seen. `read_file`, a read that takes the line through a pronoun or from its result, and a claim of the whole file do not. A probe line is no read: it says only whether a path is a file.

## Constant claims

The stage reply holds `constant_claims`. Each entry gives a constant name and its integer value in the staged tree that the plan relies on. The plan check refuses a claim whose value differs from the staged value of that constant. It also refuses a claim that names no module-level integer of the staged tree. A constant that the plan creates is not a claim.

## The spec delta

The spec of each capability in the reply has four lists, one for each delta kind of OpenSpec: `added`, `modified`, `renamed` and `removed` (#5340). A rename gives `from_name` and `to_name`, and the delta file writes it as a `- FROM:` line and a `- TO:` line under `## RENAMED Requirements`. A removal gives the name, the `reason` and an optional `migration`, and the delta file writes it as a requirement header with a `**Reason**:` line and a `**Migration**:` line under `## REMOVED Requirements`. The archive renames before it modifies, so a `modified` requirement whose text no longer fits its old name gets a `renamed` entry and takes the new name. The job copies the base scenarios that such a block omits from the old name. The gate refuses a rename or a removal on a new capability, a `from_name` or a removed name that the base spec does not have, and a `to_name` that the base spec has already. `openspec validate --strict` passes these names: it gives only the first rename that `openspec archive` refuses, as an INFO line, and no line for such a removal, which the archive skips with a warning. The review reports a `modified` requirement whose name no longer fits its text as `spec_delta_wrong`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,38 @@

Kind: behavior. Reads: `src/devops_cli/roadmap/stage/stage_change.py`, `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/stage/test_roadmap_stage_prompt_rules.py`, `tests/roadmap/stage/test_roadmap_stage_constants.py`. Changes: `src/devops_cli/roadmap/stage/stage_change.py`, `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/stage/test_roadmap_stage_constants.py`, `tests/roadmap/stage/test_roadmap_stage_prompt_rules.py`.

- [ ] 1.1 Write `test_the_stage_reply_holds_constant_claims` for `StageConstantClaim` and `constant_claims` in `tests/roadmap/stage/test_roadmap_stage_constants.py`; it fails on the base, where `StageProposal` ends its fields at `src/devops_cli/roadmap/stage/stage_change.py:699:security: Line = ""` and holds no `constant_claims`. Add `test_the_plan_check_accepts_the_plan_of_this_change`, which builds the plan's own `StageProposal` and asserts that `content_problems` returns no problem for it. Add `StageConstantClaim` to the models of `test_each_list_of_keys_of_the_reply_is_the_fields_of_a_model` in `tests/roadmap/stage/test_roadmap_stage_prompt_rules.py` for the key bullet of `src/devops_cli/ai/tasks/roadmap_stage_change.md`
- [x] 1.1 Write `test_the_stage_reply_holds_constant_claims` for `StageConstantClaim` and `constant_claims` in `tests/roadmap/stage/test_roadmap_stage_constants.py`; it fails on the base, where `StageProposal` ends its fields at `src/devops_cli/roadmap/stage/stage_change.py:699:security: Line = ""` and holds no `constant_claims`. Add `test_the_plan_check_accepts_the_plan_of_this_change`, which builds the plan's own `StageProposal` and asserts that `content_problems` returns no problem for it. Add `StageConstantClaim` to the models of `test_each_list_of_keys_of_the_reply_is_the_fields_of_a_model` in `tests/roadmap/stage/test_roadmap_stage_prompt_rules.py` for the key bullet of `src/devops_cli/ai/tasks/roadmap_stage_change.md`
- Verification: `$ uv run devops ci test tests/roadmap/stage/test_roadmap_stage_constants.py tests/roadmap/stage/test_roadmap_stage_prompt_rules.py` fails on the base
- [ ] 1.2 Add `StageConstantClaim` with `name` and `value`, and the `constant_claims` list with an empty default, to `StageProposal` in `src/devops_cli/roadmap/stage/stage_change.py`, and refuse a `name` that is not a Python identifier. Add the `constant_claims` bullet with its key list to the reply keys of `src/devops_cli/ai/tasks/roadmap_stage_change.md`, with the rule that a claim names a constant of the staged tree and that a constant the plan creates is no claim. Run `uv run devops roadmap eval stage --replay` and record the score before and after the prompt change
- [x] 1.2 Add `StageConstantClaim` with `name` and `value`, and the `constant_claims` list with an empty default, to `StageProposal` in `src/devops_cli/roadmap/stage/stage_change.py`, and refuse a `name` that is not a Python identifier. Add the `constant_claims` bullet with its key list to the reply keys of `src/devops_cli/ai/tasks/roadmap_stage_change.md`, with the rule that a claim names a constant of the staged tree and that a constant the plan creates is no claim. Run `uv run devops roadmap eval stage --replay` and record the score before and after the prompt change
- Verification: `$ uv run devops ci test tests/roadmap/stage/test_roadmap_stage_constants.py tests/roadmap/stage/test_roadmap_stage_prompt_rules.py` passes
- [ ] 1.3 Edit `src/devops_cli/ai/tasks/roadmap_stage_change.md`
- [x] 1.3 Edit `src/devops_cli/ai/tasks/roadmap_stage_change.md`
- Verification: `$ uv run devops ci docs` passes

## 2. Judge each structured claim in the plan check

Kind: behavior. Reads: `src/devops_cli/roadmap/stage/stage_change.py`, `src/devops_cli/roadmap/stage/stage_constants.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/stage/test_roadmap_stage_plan.py`. Changes: `src/devops_cli/roadmap/stage/stage_change.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/stage/test_roadmap_stage_plan.py`.

- [ ] 2.1 Write `test_check_proposal_refuses_a_wrong_constant_claim`, `test_check_proposal_refuses_a_claim_the_tree_does_not_define`, `test_check_proposal_runs_the_prose_scan_only_with_no_claim_list` and `test_check_proposal_judges_no_claim_without_staged_values` in `tests/roadmap/stage/test_roadmap_stage_plan.py`. They fail on the base, where `check_proposal` judges only the prose of `src/devops_cli/roadmap/stage/stage_change.py:2440:ProposalGate.CONSTANTS: constant_problems(plan_texts(proposal), constants or {}),`. Keep `test_the_plan_check_accepts_the_plan_of_this_change` passing: it builds the plan's own `StageProposal` and asserts that `content_problems` returns no problem for it
- [x] 2.1 Write `test_check_proposal_refuses_a_wrong_constant_claim`, `test_check_proposal_refuses_a_claim_the_tree_does_not_define`, `test_check_proposal_runs_the_prose_scan_only_with_no_claim_list` and `test_check_proposal_judges_no_claim_without_staged_values` in `tests/roadmap/stage/test_roadmap_stage_plan.py`. They fail on the base, where `check_proposal` judges only the prose of `src/devops_cli/roadmap/stage/stage_change.py:2440:ProposalGate.CONSTANTS: constant_problems(plan_texts(proposal), constants or {}),`. Keep `test_the_plan_check_accepts_the_plan_of_this_change` passing: it builds the plan's own `StageProposal` and asserts that `content_problems` returns no problem for it
- Verification: `$ uv run devops ci test tests/roadmap/stage/test_roadmap_stage_plan.py tests/roadmap/stage/test_roadmap_stage_constants.py` fails on the base
- [ ] 2.2 Add `claim_problems` to `src/devops_cli/roadmap/stage/stage_change.py`: with no `constants` it judges no claim; otherwise it refuses a claim whose value differs with `stage_problem_constant_mismatch`, and a claim whose name the mapping lacks with the new `stage_problem_constant_undefined`. Run the prose scan only when `constant_claims` is empty. Add `stage_problem_constant_undefined` to `src/devops_cli/lang/en/messages.py`. Run `uv run devops roadmap eval stage --replay` and record the score before and after the gate change
- [x] 2.2 Add `claim_problems` to `src/devops_cli/roadmap/stage/stage_change.py`: with no `constants` it judges no claim; otherwise it refuses a claim whose value differs with `stage_problem_constant_mismatch`, and a claim whose name the mapping lacks with the new `stage_problem_constant_undefined`. Run the prose scan only when `constant_claims` is empty. Add `stage_problem_constant_undefined` to `src/devops_cli/lang/en/messages.py`. Run `uv run devops roadmap eval stage --replay` and record the score before and after the gate change
- Verification: `$ uv run devops ci test tests/roadmap/stage/test_roadmap_stage_plan.py tests/roadmap/stage/test_roadmap_stage_constants.py` passes

## 3. Read the staged value of each claimed name

Kind: behavior. Reads: `src/devops_cli/roadmap/stage/stage_constants.py`, `src/devops_cli/roadmap/stage/stage.py`, `tests/roadmap/stage/test_roadmap_stage_apply.py`. Changes: `src/devops_cli/roadmap/stage/stage_constants.py`, `src/devops_cli/roadmap/stage/stage.py`, `tests/roadmap/stage/test_roadmap_stage_constants.py`.

- [ ] 3.1 Write `test_claimed_names_adds_the_names_of_the_claims` for `claimed_names` in `tests/roadmap/stage/test_roadmap_stage_constants.py`; it fails on the base, where `src/devops_cli/roadmap/stage/stage_constants.py:287:__all__ = [` lists no `claimed_names`. Keep the stage job cases of `tests/roadmap/stage/test_roadmap_stage_apply.py` passing
- [x] 3.1 Write `test_claimed_names_adds_the_names_of_the_claims` for `claimed_names` in `tests/roadmap/stage/test_roadmap_stage_constants.py`; it fails on the base, where `src/devops_cli/roadmap/stage/stage_constants.py:287:__all__ = [` lists no `claimed_names`. Keep the stage job cases of `tests/roadmap/stage/test_roadmap_stage_apply.py` passing
- Verification: `$ uv run devops ci test tests/roadmap/stage/test_roadmap_stage_constants.py tests/roadmap/stage/test_roadmap_stage_apply.py` fails on the base
- [ ] 3.2 Add `claimed_names(texts, claimed)` to `src/devops_cli/roadmap/stage/stage_constants.py`: the names that `candidate_names` finds in `texts`, with each claimed name. Call it at `src/devops_cli/roadmap/stage/stage.py:2230:constants = staged_constants(self._source, self._sha, candidate_names(plan_texts(proposal)))`, so the reader sees each claimed name
- [x] 3.2 Add `claimed_names(texts, claimed)` to `src/devops_cli/roadmap/stage/stage_constants.py`: the names that `candidate_names` finds in `texts`, with each claimed name. Call it at `src/devops_cli/roadmap/stage/stage.py:2230:constants = staged_constants(self._source, self._sha, candidate_names(plan_texts(proposal)))`, so the reader sees each claimed name
- Verification: `$ uv run devops ci test tests/roadmap/stage/test_roadmap_stage_constants.py tests/roadmap/stage/test_roadmap_stage_apply.py` passes

## 4. Describe the claim list in the stage guide

Kind: other. Reads: `docs/roadmap/stage.md`, `src/devops_cli/ai/tasks/roadmap_stage_change.md`. Changes: `docs/roadmap/stage.md`.

- [ ] 4.1 Describe the `constant_claims` key of the stage reply in `docs/roadmap/stage.md`: one entry for each constant that the plan relies on, with its staged value, the refusal of a claim that differs from the staged value, and the refusal of a claim that names no module-level integer of the staged tree
- [x] 4.1 Describe the `constant_claims` key of the stage reply in `docs/roadmap/stage.md`: one entry for each constant that the plan relies on, with its staged value, the refusal of a claim that differs from the staged value, and the refusal of a claim that names no module-level integer of the staged tree
- Verification: `$ uv run devops ci docs` passes
- [ ] 4.2 Edit `docs/roadmap/stage.md`
- [x] 4.2 Edit `docs/roadmap/stage.md`
- Verification: `$ uv run devops ci docs` passes

## Workflow follow-up
Expand Down
Loading