Skip to content

fix(roadmap): the constants gate reads only a stated value - #5042

Merged
dan-petty merged 3 commits into
mainfrom
fix/5034-the-constants-gate-reads-only-a
Nov 12, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/5034-the-constants-gate-reads-only-a

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The constants gate of the stage job took any one number in a sentence that names a constant as the value of that constant. It refused good plans for lines 1790-2000 (the regex backtracked to 179), NAME + 1, -n 0, line 266 and the value of a new constant beside a known one: 5 false problems in the refused reply of #4472, 3 in that of #4043.

The gate now compares a number only when it follows the constant name with =, is or to, and the number regex takes whole numbers only. The change only removes candidate numbers, so the gate refuses no plan that it accepted before. "SUMMARY_MAX_CHARS is 40" while the tree holds 60 (#3200) is still refused.

Closes #5034

Change: openspec/changes/archive/2026-11-12-5034-the-constants-gate-reads-only-a/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results (local, before the push)

fail-to-pass (uv run devops ci fail-to-pass --base origin/main, 87ae9ee):

failed on base: ...test_constant_problems_ignores_number_that_is_no_value_of_the_constant[line-range] (AssertionError: assert ['DEFAULT_CI_...an says 179.'] == [])
failed on base: ...[new-constant-value] (AssertionError: assert ['DEFAULT_CI_...lan says 50.'] == [])
failed on base: ...[operand] (AssertionError: assert ['DEFAULT_CI_...plan says 1.'] == [])
failed on base: ...[line-number] (AssertionError: assert ['CONST_ROADM...an says 266.'] == [])
failed on base: ...[option-value] (AssertionError: assert ['DEFAULT_CI_...plan says 0.'] == [])
failed on base: ...[new-constant-of] (AssertionError: assert ['CONST_ROADM...plan says 3.'] == [])
6 failed on base (6 failed and 14 passed in tests/roadmap/stage/test_roadmap_stage_constants.py; 0 errored).

On the change, uv run devops ci test tests/roadmap/stage/test_roadmap_stage_constants.py gives 20 passed. The four value claims (is, =, : Final[int] =, to) are still refused on the base and on the change.

Stage eval replay (uv run devops roadmap eval stage --replay --json): the output is byte-identical on the base and on the change. 58 cases, good plans 5/5 accepted, failures none. Gates: paths 53/53, kind 25/25, criteria 0/0, content 3/3, prompt_keys 1/1 caught, 0 missed. No case of the set records constants, so the replay does not use this gate.

Recorded refused replies (constant_problems over each sentence of the stored reply):

Reply Base Change
#4472 (2026-11-11) 5 problems: 179, 1, 0, 0, 50 0
#4043 (2026-11-11) 3 problems: 3, 266, 267 0

Other checks: uv run devops ci --check --only lint,format,docs,constructs,openspec,test-tree all pass; mypy on the two changed files: no issues; tests/roadmap/stage/test_roadmap_stage_eval_gates.py and tests/roadmap/stage/test_roadmap_stage_plan.py with -k constant: 2 passed; uv run devops openspec check after the archive: passed.

This is Service code (the stage job). It waits for the owner's "safe and vetted" call before the merge.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 11:30
@devops-cli-service

Copy link
Copy Markdown
Contributor

Pull request #5042 has merge conflicts with main at commit dd0f3fad5dc3. GitHub cannot merge it. Rebase the branch onto the current main, resolve the conflicts and push the branch.

@dan-petty
dan-petty enabled auto-merge (squash) November 12, 2026 12:41
The constants gate compares a number with a constant only when the
number follows the constant name with `=`, `is` or `to`. The number
regex takes whole numbers, so `lines 1790-2000` gives no 179.

Closes #5034
@dan-petty
dan-petty force-pushed the fix/5034-the-constants-gate-reads-only-a branch from dd0f3fa to 3bb128d Compare November 12, 2026 13:14
@dan-petty
dan-petty merged commit cf4733e into main Nov 12, 2026
23 checks passed
@dan-petty
dan-petty deleted the fix/5034-the-constants-gate-reads-only-a branch November 12, 2026 13:27
@dan-petty

Copy link
Copy Markdown
Owner Author

Do not merge yet. The independent review of this PR found one blocking defect: the number regex still cuts a Python int literal with a digit separator. A correct quote of CONST_AGENTS_MD_MAX_CHARS: Final[int] = 6_500 is still refused with "the plan says 6", which is a false refusal that #5034 lists. The review also found that the to link refuses a good plan that changes a value ("Raise X to 40"). A fix round on this branch is in progress. The checks are green, but this PR stays unvetted until the fix is pushed and checked.

@dan-petty

Copy link
Copy Markdown
Owner Author

This pull request merged before the fix of its review findings. #5069 records the open findings (a literal with _ digit separators, such as 6_500, and a new value after to), and #5080 fixes them.

dan-petty added a commit that referenced this pull request Nov 12, 2026
The constants gate of the stage job refused two forms of a good plan
after #5042.

- A quote of a literal with `_` digit separators, such as
`CONST_AGENTS_MD_MAX_CHARS: Final[int] = 6_500`, gave "the plan says 6".
`_CANDIDATE_NUMBER` now takes `(\d+(?:_\d+)*)`, so `6_500` is one number
(6500).
- A new value after `to` ("Raise `NAME` to 80") always differs from the
staged value, because the staged tree is the commit before the change.
`_VALUE_LINK` has no `to`. A claim with `is` or `=` that differs from
the staged tree is still refused.

A wrong new value after `to` is no longer refused; #3388 adds structured
claims for it. The proposal corrects the archived change of #5034: the
gate has no recorded true positive (no gate refuses the real #3200
plan), a sentence with a line range and a value claim is now checked,
and it lists the forms that the gate no longer refuses.

Closes #5069

Change:
`openspec/changes/archive/2026-11-12-5069-the-constants-gate-reads-6-500/`
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.119.0](v0.118.0...v0.119.0)
(2026-11-12)


### Features

* **repos:** the claim sets In Progress
([#5111](#5111))
([06ef1c6](06ef1c6))
* **roadmap:** a fix-plan step repairs a plan PR with open findings
([#5104](#5104))
([ca5b16d](ca5b16d))
* **roadmap:** extend stage review rounds while open findings drop
([#5090](#5090))
([bacf713](bacf713))
* **roadmap:** re-anchor a stale citation that matches one line
([#5040](#5040))
([16356d8](16356d8))


### Bug Fixes

* **ci:** keep failed test IDs in the service image shard summary
([#5106](#5106))
([88589ef](88589ef))
* **github:** count each page of a paginated GitHub read
([#5070](#5070))
([908e24a](908e24a))
* **github:** keep the metrics permissions out of the runner Job token
([#5064](#5064))
([fb549ff](fb549ff))
* **github:** pace mutations through the clock seam
([#5063](#5063))
([2bd87bc](2bd87bc))
* **k8s:** delete the CoreDNS files that k3s never applies
([#5055](#5055))
([463f601](463f601))
* **monitoring:** tidy LLM stack windows, units and lines
([#5052](#5052))
([375d724](375d724))
* **roadmap:** a refused kept plan uses no stage gate return
([#4983](#4983))
([b8adbca](b8adbca))
* **roadmap:** count a command as removed only when MUST NOT governs it
([#4985](#4985))
([2e6f407](2e6f407))
* **roadmap:** cut prose after a cited stage command
([#4982](#4982))
([a172563](a172563))
* **roadmap:** name every module of a group with no named test
([#5089](#5089))
([27a0e79](27a0e79))
* **roadmap:** stage returns every open review finding to the planner
([#5067](#5067))
([21b116e](21b116e))
* **roadmap:** the alternatives check reads the tools in use
([#5062](#5062))
([8903233](8903233))
* **roadmap:** the constants gate reads 6_500 and no new value
([#5080](#5080))
([8a7b113](8a7b113))
* **roadmap:** the constants gate reads only a stated value
([#5042](#5042))
([cf4733e](cf4733e))
* **telemetry:** read repository traffic as the GitHub App
([#4932](#4932))
([7c42823](7c42823))
* **tests:** close the UDP, DNS and git gaps of the network floor
([#5101](#5101))
([047ee48](047ee48))
* **tests:** repair the bwrap contract suite and gate it
([#5110](#5110))
([9a0659d](9a0659d)),
closes [#4715](#4715)


### Performance Improvements

* **ci:** build the Service image once for its test shards
([#5079](#5079))
([dcf5bd5](dcf5bd5))
* **ci:** run only the required checks on the release PR
([#5057](#5057))
([8174071](8174071))
* **ci:** stop the cache export of pull request image builds
([#5113](#5113))
([ba30820](ba30820))
* **roadmap:** consolidate keeps its vectors in the shared tiers
([#5099](#5099))
([2a8bf1a](2a8bf1a))


### Code Refactoring

* **roadmap:** one Status writer for every job
([#5109](#5109))
([24cfedc](24cfedc))

---
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): the constants gate reads only a stated value

1 participant