Skip to content

fix(roadmap): the module-test and caller gates read imports and calls - #4490

Merged
dan-petty merged 2 commits into
mainfrom
fix/4467-module-test-and-caller-gates-refuse-correct-plans
Nov 11, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/4467-module-test-and-caller-gates-refuse-correct-plans

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The module-test gate (#3414) counted a test that held the dotted name of a module as text, and grep_at read each dot as a regex wildcard. So a plan that changed the messages module had to name tests/commands/test_new.py, which holds only its path. The caller gate (#3307) read a function name across sentences, took a class as a function, and matched scan_fix( for _fix(.

  • A test of a module now imports it, a package that imports it, or another changed module that imports it. ast and build_import_graph read the imports.
  • grep_at searches a fixed string.
  • The caller gate reads only a clause that adds a parameter, an argument or a keyword, and ast finds the calls. A name with no def has no caller.
  • The plan recheck reads files at its revision.

Closes #4467

Change: openspec/changes/archive/2026-11-11-4467-the-module-test-and-caller-gates/

@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 11, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Measurements and checks

Fail-to-pass

uv run devops ci fail-to-pass --base origin/main:

38 failed on base (38 failed and 83 passed in tests/roadmap/stage/test_roadmap_stage_paths.py; 0 errored).

The behavior failures on the base include test_the_caller_check_reads_only_a_parameter_that_a_task_adds[test-function-of-a-test-file] (assert ['check_proposal'] == []) and the other false cases of that table. The tests of the record fail on the base with TypeError: StagedTree.__init__() got an unexpected keyword argument 'reader', because the base tree reads no file and counts text.

The stored refused replies

I replayed record_module_tests, existing_test_problems and caller_problems over the 36 stored refused replies (<n>.refused.json of 18 items, 2026-11-10 and 2026-11-11), on the tree of commit 6cf78e73 for the base and for the change. The script and the outputs are in the agent scratch folder, not in the repository.

Base Change
Module-test problems 35 19
Caller problems 26 4
Replies with a module-test or caller problem 27 12
Replies whose only stored problems are these gates 5 2 still refused

The change clears 3 refusals outright: 3049 reply 2, and 4043 replies 1 and 2. On those replies the stored problem holds only module-test or caller problems, and the changed gates give none.

What stays, and why:

  • Caller: 4 problems stay, and all 4 are true. #3407 reply 2 and #3423 reply 1 add the keyword class_text or the keyword-only argument base_scenarios to check_gates and check_proposal, and they leave out plan_recheck.py, implement.py and plan_check.py, which call them. One of them (check_gates in #3423 reply 1) is new: the base pattern was case-sensitive and missed add the keyword-only argument.
  • Caller, cleared and false: FailureClass (8, an enum member), skipped (6, a list in a later sentence), TaskGroup (4, a property, and the callers called asyncio.TaskGroup), _fix (4, the callers called scan_fix and similar names) and StageProposal (1, a model field with an empty default; the call in plan_read.py stays valid). The study counted StageProposal as true; I count it false, because the caller gate is about the signature of a function (feat(roadmap): name every caller of a changed function #3307).
  • Module-test, cleared and false: 14 of the 16 problems of src/devops_cli/lang/en/messages.py and both of src/devops_cli/lang/en/help.py (the gate asked for tests/commands/test_new.py), and src/devops_cli/config/defaults.py of #4401 (the group reads tests/commands/test_scan.py, whose module scan.py imports the defaults).
  • Module-test, still refused: 19 problems. 16 of them are on modules other than the messages: the group names no test that imports the module, or a changed module that imports it (store.py, implement_run.py, stage.py, plan_check.py, stage_specs.py, stage_eval_cases.py, stage_request.py, stage_screen_eval.py, github/client.py, stage_validate.py, commands/roadmap.py, explain.py). These are true under the rule of fix(roadmap): refuse a behavior group that omits a test it changes #3414. The 3 messages problems (#3076 replies 1 and 2, #3387 reply 1) are groups that name only tests that they create, which fix(roadmap): refuse a behavior group that omits a test it changes #3414 refuses on purpose. One of them (#3076 reply 2) is new: that reply named tests/commands/test_new.py to satisfy the base gate, and that file does not import the messages (its from devops_cli.lang import HELP is text of a scaffold).

Stage eval replay

uv run devops roadmap eval stage --replay gives the same output on the base (54743c44) and on the change. The replay tree has no checkout and no reader (StagedTree(self.facts.tracked)), so it judges neither gate before or after the change. No defect that a gate caught is lost, and 5 of 5 good plans pass.

Gate     Issue  Known  Caught  Missed
paths    #3010     52      52       0
kind     #3005     25      25       0
criteria #3019      0       0       0
content  #3200      3       3       0
prompt_keys #3328      1       1       0

Defect type               Caught  Missed  Waiting  No gate  Total
missing_path                  37       0        0        0     37
false_premise                  1       0        0       60     61
spec_delta_wrong               6       0        0       19     25
verify_form                    6       0        0       12     18
task_order                     1       0        0        8      9
criterion_dropped              0       0        0       13     13
ignores_existing_code          0       0        0       23     23
contrived_test                24       0        0        3     27
other                          5       0        0       99    104
prompt_key_missing             1       0        0        0      1
Defects that a gate judges: 81 of 318 (25%).

Good plans that every gate accepts: 5 of 5.
Result: every gate refuses what it must refuse.

The items that failed stage 3 or more times

From the stage failures of the 48-hour window (2026-11-09 to 2026-11-10), I count 27 items with 3 or more failures; the brief counts 21. The stored refused replies cover 13 of them. Of those:

  • Unblocked on the stored evidence: #4043. Both stored replies fail only on the messages module and pass with the change. #3049 (5 failures in the 7-day window) also passes on its second reply.
  • The module-test and caller problems go, but other gates still refuse the stored replies: #3388, #3389, #3398, #3416, #3453, #4028 (reply 2). Another stage run can pass these when the model fixes the other problems.
  • True problems stay: #3076, #3387, #3407, #3423, #3447.
  • No module-test or caller problem in their failures: #3414, #3429, #3443, #3451, #3462, #3532, #3576, #3577, #3592, #3599, #3612, #3634, #3637, #3642, #4004. This change does not unblock them.

The live Service

The change needs no ConfigMap or Secret change. The Service gets it with the next image.

Local CI

flock .data/agent/ci.lock uv run devops ci passed every row except test-tree: a @cache closure in plan_recheck.py broke the process-state invariant. The next commit uses a dict in the closure, and the test-tree row then gave test-tree: 12 cases, 0 failed. The test row took 28 minutes on the shared host under load; the GitHub runner shards it.

@dan-petty
dan-petty marked this pull request as ready for review November 11, 2026 05:06
@dan-petty
dan-petty enabled auto-merge (squash) November 11, 2026 05:06
@dan-petty
dan-petty force-pushed the fix/4467-module-test-and-caller-gates-refuse-correct-plans branch from 12bdd01 to 2855d2f Compare November 11, 2026 05:13
A test of a changed module is a test that imports it, a package that imports it, or another changed module that imports it. A string or a path that holds the name is no import. The caller gate reads only a task clause that adds a parameter, an argument or a keyword, and it finds the calls with ast. grep_at searches a fixed string.
@dan-petty
dan-petty force-pushed the fix/4467-module-test-and-caller-gates-refuse-correct-plans branch from 2855d2f to fa54fe0 Compare November 11, 2026 05:50
@dan-petty

Copy link
Copy Markdown
Owner Author

Rebased onto main after the merge of the trace gate change (#4463). Head is now fa54fe04.

The only conflict was in the archive commit, in openspec/specs/roadmap-stage/spec.md: main added the requirement "The trace gate reads the path of each citation form" at the end of the spec, and this change adds "A test that holds the name of a module in text is no test of it" at the same place. The resolution keeps both requirements, in that order. The code commit applied with no conflict.

Checks on the rebased head:

  • uv run devops openspec check: passed.
  • uv run devops ci test tests/roadmap/stage: 2,244 passed, 1 skipped.
  • uv run devops roadmap eval stage --replay: 57 cases, 5 good; defects that a gate judges: 81 of 318 (25%); good plans that every gate accepts: 5 of 5; every gate refuses what it must refuse.

@dan-petty
dan-petty merged commit 8a22e82 into main Nov 11, 2026
32 checks passed
@dan-petty
dan-petty deleted the fix/4467-module-test-and-caller-gates-refuse-correct-plans branch November 11, 2026 06:04
@dan-petty

Copy link
Copy Markdown
Owner Author

Review findings after merge:

  • Major, confirmed: changed_functions in src/devops_cli/roadmap/stage/stage_paths.py reads a function only when the clause holds the word parameter, argument or keyword. So the plain form Add xtofn gives no function, and the caller gate does not refuse a plan that leaves out a caller. A probe of `main` gives `[]` for `Add `known` to `build_import_graph and gives ['build_import_graph'] only for Add the keyword knowntobuild_import_graph``. The PR also changed the refused test case to the keyword form. This PR is merged, so I did not push a fix to it. I filed fix(roadmap): the caller gate reads an added parameter span #4529 for the fix.

No minor findings.

dan-petty added a commit that referenced this pull request Nov 11, 2026
The caller gate (#3307) of the stage plan check reads again the most
frequent task form, Add `x` to `fn` or Add `x: T = d` to `fn`. Since
#4490 it read a function only when the clause said parameter, argument
or keyword, so a plan that added a parameter in the plain form and left
out a caller passed.

- `changed_functions` in `src/devops_cli/roadmap/stage/stage_paths.py`
also reads a clause whose added part is one code span, alone or after
`the`, that `ast` reads as the parameters of a `def`. A decorator, an
option and a constant in capitals are no parameter. The `def` filter of
`calling_files` drops a class or an enum.
- The tests use the plain form Add `probes` to `check_proposal` again,
add the true and false span forms, and keep a field of a model free of a
caller problem.
- `docs/ROADMAP_WORKFLOW.md` and the `roadmap-stage` requirement state
the rule.

Closes #4529

Change:
`openspec/changes/archive/2026-11-11-4529-the-caller-gate-reads-an-added/`
dan-petty pushed a commit that referenced this pull request Nov 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.112.0](v0.111.0...v0.112.0)
(2026-11-11)


### Features

* **k8s:** export gateway spans without key metadata
([#4520](#4520))
([7234d71](7234d71))
* **k8s:** set the homelab domain in container env values
([#4608](#4608))
([a3bcf7c](a3bcf7c))
* **telemetry:** send pydantic-ai spans through the exporter seam
([#4538](#4538))
([fcf2a7a](fcf2a7a))


### Bug Fixes

* **ai:** price cached prompt tokens of chat calls
([#4584](#4584))
([f84bbe6](f84bbe6))
* **devcontainer:** stop uv noise lines in agent shells
([#4592](#4592))
([9ba375c](9ba375c))
* **k8s:** delete gateway management bodies from spans
([#4551](#4551))
([b835d3c](b835d3c))
* **k8s:** set the kube context and namespace on devops pods
([#4514](#4514))
([9087b39](9087b39))
* **roadmap:** a refused spec after the archive is a plan defect
([#4549](#4549))
([1db29f7](1db29f7))
* **roadmap:** count and log the reason of a left-out stage item
([#4541](#4541))
([5600179](5600179))
* **roadmap:** default the step ceiling to twice the budget
([#4556](#4556))
([1dfb6c8](1dfb6c8))
* **roadmap:** explain --trace shows the argument digest
([#4526](#4526))
([c92195f](c92195f))
* **roadmap:** explain totals count dropped model events
([#4543](#4543))
([fe0e979](fe0e979))
* **roadmap:** give each eval verify run its own report file
([#4534](#4534))
([ad27f2d](ad27f2d))
* **roadmap:** one event loop and a time limit for decide_all
([#4585](#4585))
([ec51e01](ec51e01))
* **roadmap:** scoped updates send requests with no row scope
([#4531](#4531))
([5f75d25](5f75d25))
* **roadmap:** the caller gate reads an added parameter span
([#4548](#4548))
([1ba07c1](1ba07c1))
* **roadmap:** the implement shell waits for its command
([#4536](#4536))
([571e044](571e044))
* **roadmap:** the module-test and caller gates read imports and calls
([#4490](#4490))
([8a22e82](8a22e82))
* **service:** put trace ids on Service JSON log lines
([#4511](#4511))
([0d7a0d2](0d7a0d2))


### Performance Improvements

* **ai:** keep intake embeddings between CLI runs
([#4546](#4546))
([812871e](812871e))
* **roadmap:** intake reads only the issues that changed
([#4552](#4552))
([7dfd155](7dfd155))

---
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 module-test and caller gates refuse correct plans

1 participant