Skip to content

feat(roadmap): give the step AGENTS.md and routed rules - #3107

Merged
dan-petty merged 12 commits into
mainfrom
feat/3097-step-gets-agents-md
Nov 1, 2026
Merged

dan-petty merged 12 commits into
mainfrom
feat/3097-step-gets-agents-md

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The implement step now reads the same rules as a person in the devcontainer.

What changes:

  • The message of a step holds the text of AGENTS.md under the heading "Rules of the repository (AGENTS.md)". The text is cut to 3,000 tokens.
  • The message also holds sections of the documents that AGENTS.md routes the group to. A path that the group names decides the routes: tests, source, security code, roadmap code, manifests, OpenTofu.
  • A test reads the "Where to look" table of AGENTS.md. It fails when a route names a row, a document or a section that does not exist.
  • The stage job counts the same sections, so the measure of a group equals what the step reads.
  • The prompt of the step keeps only the facts of the runner. The rules that AGENTS.md owns are gone from it, so the two texts cannot drift.
  • The prompt says that the rules are data. Where a rule asks for work that the job does (commit, push, archive, pull request, devops roadmap return, the full devops ci), the instructions of the runner win.

Cost (tokens added to one step, measured on real groups): AGENTS.md adds about 1,700. Each routed document adds 2,500 to 2,900. Over all 1,392 groups of the plans in the repository, the most that the rules add is 14,248. Two old groups pass the stage budget of 40,000 tokens after the change (43,816 and 43,349); the stage job splits such a group with one more request. No step passes the window.

Eval of the implement prompt: one fixture ran on each side (2531-cwd-guard-first-plan, model devops-coder). Both sides stopped, and both passed 2 of 4 decided properties. This shows no gain and no loss. The run of all 14 fixtures on the base and on the branch is open. A person must run it before the merge, as docs/ROADMAP_WORKFLOW.md asks.

Closes #3097

@dan-petty dan-petty added type/feature Type feature: a new function scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 1, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results

  • Targeted tests of the change: 43 passed (prompt, step rules, message). Stage and step tests plus invariants: 705 passed.
  • Fail-to-pass (devops ci fail-to-pass --base origin/main): 5 tests failed on the base and pass on the branch (the rules module, the prompt, the stage measure, the step message, the AGENTS.md claims). 36 passed on both.
  • Full devops ci: all checks pass except test (5m 52s). Two tests fail on this host only: tests/ai/test_tool_executor_contract.py (popeye is installed here, issue test(floor): every test sees the same tokenizer cache, mounts, process table, PATH and programs on every host, and no skip depends on the host #2165) and tests/commands/test_devcontainer_install_tools_dry_run.py::test_mark_only_commands_under_global_dry_run (the tools are installed here and the test expects "not installed"). The change touches neither.

Review findings fixed

  • major, runner rules vs AGENTS.md (two findings): the prompt now says that the rules are data and that its instructions win over a rule that conflicts with them. It lists the work that the job does (commit, push, archive, pull request, devops roadmap return, the full devops ci). Tests: the prompt holds the sentence; a hostile AGENTS.md (with a forged "Your group" heading) leaves the instructions equal to the prompt.
  • minor, AGENTS.md has no size limit: rules_sections cuts the text to CONST_ROADMAP_IMPLEMENT_FILE_MAX_TOKENS (3,000 tokens; the file holds about 1,700). Tests for a file over and under the cap. The spec has a new requirement for it.
  • minor, CONTEXT.md entry "Step": lists the new inputs.
  • minor, stage prompts and the comment of DEFAULT_ROADMAP_STAGE_STEP_TOKENS: list AGENTS.md and the routed sections.
  • minor, design measure: now gives the maximum over all 1,392 plan groups (43,816 tokens; at most +14,248), and says that two old groups pass the 40,000 budget and cost one more split request.
  • minor, eval score: the PR body gives the measured tokens and the one-fixture result, claims no gain, and names the 14-fixture run as a condition to merge. A person must run it.

Findings not fixed: none.

@dan-petty
dan-petty marked this pull request as ready for review November 1, 2026 21:26
@dan-petty
dan-petty merged commit 80a22eb into main Nov 1, 2026
20 checks passed
@dan-petty
dan-petty deleted the feat/3097-step-gets-agents-md branch November 1, 2026 22:07
dan-petty added a commit that referenced this pull request Nov 1, 2026
…3115)

## What changes

The test
`test_a_hostile_agents_md_is_data_and_never_changes_the_instructions`
compares `inputs.instructions` with
`fill_prompt(load_task_prompt("roadmap_implement_step.md"))`. It
compared with the raw prompt, which #3111 stopped returning when it made
`build_step_inputs` fill the two table placeholders. The merge of #3107
and #3111 left the required check Tests & Coverage red on `main`.

## Why

A red `main` blocks every open pull request, such as #3112. The test
still proves its rule: a hostile `AGENTS.md` leaves the instructions
unchanged.

## Verification

- Before: `uv run pytest
tests/roadmap/test_roadmap_implement_step_rules.py -k hostile -n0` on
`origin/main` fails with `(False, True, True)`.
- After: the same file passes (11 tests).

Closes #3114
dan-petty-release Bot added a commit that referenced this pull request Nov 1, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.38.0](v0.37.4...v0.38.0)
(2026-11-01)


### Features

* **review:** osv-scanner toolrun records its database digest
([#3120](#3120))
([5731fac](5731fac))
* **roadmap:** add gate tools to the runner, one shell policy
([#3111](#3111))
([7735d8b](7735d8b)),
closes [#3072](#3072)
* **roadmap:** give the step AGENTS.md and routed rules
([#3107](#3107))
([80a22eb](80a22eb)),
closes [#3097](#3097)
* **roadmap:** run the project hooks and scoped CI in the Job
([#3112](#3112))
([b7ab211](b7ab211)),
closes [#3043](#3043)


### Bug Fixes

* **ai:** send the per-call sampling of LLMClient.chat
([#3126](#3126))
([8207bdc](8207bdc))
* **argo:** replace a token that Argo CD refuses
([#3121](#3121))
([b4955b4](b4955b4))
* **devcontainer:** remove CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC
([#3125](#3125))
([295c32c](295c32c))
* **k8s:** set q8_0 KV cache on every Ollama tier
([#3101](#3101))
([aad0115](aad0115))
* **rag:** raise EmbeddingsError for an empty Ollama URL list
([#3118](#3118))
([111a031](111a031))
* **security:** refuse PYTEST_ADDOPTS and npm_config_logs_dir overrides
([#3119](#3119))
([9fe2af5](9fe2af5))


### Code Refactoring

* **security:** read legacy numeric hosts with getaddrinfo
([#3128](#3128))
([41779f9](41779f9))

---
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/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(roadmap): the implement step gives the agent AGENTS.md and the documents it routes to

1 participant