Skip to content

feat(roadmap): a toolchain preset sets the implement checks #4635

Closed

Description

@dan-petty

Problem or Motivation

  • src/devops_cli/roadmap/implement/implement_scoped_ci.py:131-141 always builds uv run devops ci --check --only constructs,docs,openspec (src/devops_cli/config/constants.py:3446).
  • In a clone with no sgconfig.yml, constructs fails ("No ast-grep project configuration is found").
  • With no openspec/config.yaml, openspec check exits 1 (src/devops_cli/openspec/gate.py:167-169, src/devops_cli/commands/openspec.py:34-36).
  • uv run devops with the clone as working directory syncs the environment of a target that has a pyproject.toml (vibes).
  • The tests check runs uv run devops ci test (pytest).
  • src/devops_cli/roadmap/implement/implement_step.py:1231-1275 adds ruff format, ruff check and mypy --strict for every Python repository.
  • fix(zsh): Move PATH before starship check and dedupe entries dotfiles#3 stopped at static on 2026-11-04 23:36Z, after fix(roadmap): run a project step only where the repo has it #3534.
  • Only 2 booleans ([implement.steps] docs and archive) come from the target.

Owner decision 5 (2026-11-11): implement runs in all 7 repositories. So the check set must come from the toolchain of each repository.

Proposed Solution & Architectural Design

  • Move implement_steps.py to src/devops_cli/roadmap/project_profile.py. Add resolve_profile(source, ref) -> ProjectProfile, a frozen pydantic value, with the trusted read at origin/<default> (the trust rule of fix(roadmap): a job runs a project step only where the repo has it #3484).
  • Add src/devops_cli/roadmap/toolchains.py with the frozen-dataclass presets devops-cli and neutral. A preset holds: the shell programs, the local commands, the refusals, the static check, the test command with {tests}, the test selection, the verify prefixes, the docs step, the docs verification, the archive argv, the step gates, the review bullet and the self-hosting prompt flag.
  • .devops/roadmap.toml gets [project] toolchain = "neutral" | "devops-cli" (default neutral). Remove [implement.steps] with no shim.
  • scoped_checks reads static_check and test_command from the preset. With neutral there are none: only the pre-push hooks of the target run, then the pull request CI that the job already watches and repairs (implement_run.py:1640-1670).
  • The docs step runs when the preset has docs_step. The archive step runs when uses_openspec (fix(roadmap): stage holds an item where openspec is not set up #4629) is true, with the archive_argv of the preset (neutral: openspec archive <change> --yes).
  • The ruff and mypy step gates run only with step_gates = ruff-mypy.
  • devops-cli declares toolchain = "devops-cli".
  • A later child of the tracker adds the presets for the other languages (owner decision 5).

Target Subsystem

SDLC, Git & PR Governance (src/devops_cli/roadmap/implement/).

Existing Tool Considered

pre-commit is the tool that runs the checks of each target (its pre-push hooks), and the target's own CI checks the pull request. The preset only selects which of these the job runs. No tool maps a repository to a check set, so the preset is typed data. Cost: about 150 lines and 6 tests, about 500,000 tokens and 5 hours to build, about 10,000 tokens a month to keep.

Acceptance Criteria

  • A test: for devops-cli, scoped_checks, the docs step, the archive argv and the step gates are byte-equal to today.
  • A test: for a repository with no .devops/roadmap.toml, scoped_checks holds only the pre-push check (or none when there are no hooks), and no argv names uv or devops ci.
  • A test: an unknown preset name raises ConfigurationError that names the file.
  • git grep -n 'implement.steps' src docs gives 0.
  • A live implement run on a dotfiles item ends without a static failure (test(roadmap): verify a dotfiles item makes a draft PR in a live run #3511).

Dependencies

#4629 (the uses_openspec helper). Related: #3484 and #3511.

Source: #4627

Proposed design

Problem statement

The implement job runs one fixed check set in every repository. A clone with no sgconfig.yml fails constructs, and a clone with no openspec/config.yaml fails openspec. Implement now runs in all 7 repositories, so each target must supply its check set from its toolchain preset.

Acceptance criteria

Requirement: toolchain-preset-read

The implement job SHALL take the toolchain preset from [project] toolchain in .devops/roadmap.toml, read at origin/<default>.

Scenario: The file names a preset

  • WHEN the trusted read of .devops/roadmap.toml holds toolchain = "devops-cli"
  • THEN resolve_profile returns the devops-cli preset.

Requirement: default-preset-neutral

A repository with no .devops/roadmap.toml MUST get the neutral preset.

Scenario: No profile file

  • WHEN the trusted read finds no .devops/roadmap.toml
  • THEN the resolved profile names neutral, and its scoped checks hold no argv that names uv or devops ci.

Requirement: devops-cli-parity

The devops-cli preset MUST give the scoped checks, the docs step, the archive argv and the step gates that this repository has today.

Scenario: This repository's preset

  • WHEN the profile resolves to devops-cli
  • THEN the scoped checks, docs step, archive argv and step gates equal the values of today.

Requirement: neutral-scoped-checks

A neutral profile MUST run only the pre-push hook check, with no static check and no test command.

Scenario: A neutral repository with hooks

  • WHEN the profile is neutral and the target declares pre-push hooks
  • THEN scoped_checks holds the pre-push hook check and no other check.

Requirement: unknown-preset-refused

A toolchain name that no preset holds MUST raise ConfigurationError that names the file.

Scenario: An unknown preset name

  • WHEN .devops/roadmap.toml holds toolchain = "cargo"
  • THEN resolve_profile raises ConfigurationError whose message holds .devops/roadmap.toml.

Requirement: docs-step-gated

The docs step SHALL run only when the preset declares a docs step.

Scenario: A neutral profile

  • WHEN the profile is neutral
  • THEN the job runs no docs step.

Requirement: archive-step-gated

The archive step MUST run only when uses_openspec is true, with the archive_argv of the preset.

Scenario: A neutral repository that uses OpenSpec

  • WHEN the profile is neutral and uses_openspec is true
  • THEN the archive step runs openspec archive <change> --yes.

Requirement: step-gates-gated

The ruff format, ruff check and mypy step gates MUST run only when the preset sets step_gates = ruff-mypy.

Scenario: A neutral profile with a changed Python file

  • WHEN the profile is neutral and a step changes a Python file
  • THEN the step runs no ruff command and no mypy command.

Requirement: implement-steps-removed

The [implement.steps] key MUST be gone from the code and the documents, with no shim.

Scenario: A search for the key

  • WHEN git grep -n 'implement.steps' src docs runs
  • THEN it finds no line.

Requirement: devops-cli-declares-preset

This repository's .devops/roadmap.toml MUST declare toolchain = "devops-cli".

Scenario: This repository's profile file

  • WHEN the test reads .devops/roadmap.toml
  • THEN [project] toolchain is devops-cli, and [implement.steps] is absent.

Existing Tool Considered

No alternatives check has run. pre-commit runs the checks of each target through its pre-push hooks, and the target's own CI checks the pull request. No open, maintained tool maps a repository to a check set, so the preset is typed data. Cost to build and keep it: about 150 lines and 6 tests, about 500,000 tokens and 5 hours to build, and about 10,000 tokens a month to keep.

Key questions

  • Where do the toolchain presets live, and what type holds each one?: In src/devops_cli/roadmap/toolchains.py, as two frozen dataclass values, devops-cli and neutral. (best practice) [sources: src/devops_cli/roadmap/implement/implement_scoped_ci.py, src/devops_cli/roadmap/implement/implement_step.py, .devops/roadmap.toml]
    • Chosen: A frozen dataclass module roadmap/toolchains.py. The presets are typed data with no parse cost, and each caller uses one import.
    • Rejected: Grow implement_steps.py. That file holds two booleans, and the presets add twelve fields.
    • Rejected: A TOML file for each preset. A parsed file adds a read and a schema to keep.
  • What type holds the resolved profile?: A frozen pydantic value ProjectProfile, in src/devops_cli/roadmap/project_profile.py. (best practice) [sources: pyproject.toml, src/devops_cli/config/settings.py]
    • Chosen: A frozen pydantic value. It validates the parsed file, and the repository already validates settings with pydantic.
    • Rejected: A frozen dataclass. It validates nothing, so a wrong type reaches the job.
  • Which preset does a repository get when it declares none?: neutral. It runs the target's own checks and no check of devops-cli. (best practice) [sources: src/devops_cli/openspec/gate.py, src/devops_cli/commands/openspec.py, sgconfig.yml, openspec/config.yaml]
    • Chosen: neutral. A clone with no sgconfig.yml or openspec/config.yaml fails the devops-cli rows.
    • Rejected: devops-cli. openspec check exits 1 when openspec/config.yaml is absent, and constructs fails when sgconfig.yml is absent.
  • Where does the job read .devops/roadmap.toml?: At origin/<default>, the trusted read of fix(roadmap): a job runs a project step only where the repo has it #3484. It never reads the working tree of the step. (best practice) [sources: .devops/roadmap.toml, docs/ROADMAP_WORKFLOW.md]
    • Chosen: The read at origin/<default>. The file already comes from the default branch, so a step cannot change the checks that judge it.
    • Rejected: The working tree. A step that edits the file would set its own check set.
  • Do we keep [implement.steps] with a shim?: No. The key goes, and no code reads it. A file that still holds it gets no step from it. (best practice) [sources: .devops/roadmap.toml, docs/ROADMAP_WORKFLOW.md]
    • Chosen: Remove the key with no shim. The project is pre-1.0 and writes no transition, shim or legacy mode.
    • Rejected: Keep the key as a shim. It keeps two sources for one check set.
  • Which checks run for a neutral repository?: The target's pre-push hooks, then the pull request CI that the job already watches and repairs. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md, .pre-commit-config.yaml, docs/ROADMAP_WORKFLOW.md]
    • Chosen: The pre-push hooks and the pull request CI. ADR 0004 makes CI the authoritative gate, and the hook is the fast local check.
    • Rejected: Run uv run devops ci in every target. A target with no sgconfig.yml fails the constructs row.
    • Rejected: Guess a test command from the lockfile of the target. The guess adds code that must be kept, and the target CI already runs the tests.
  • Which commands does the devops-cli static check run?: uv run devops ci --check --only constructs,docs,openspec, from CONST_ROADMAP_IMPLEMENT_SCOPED_ROWS. [sources: src/devops_cli/roadmap/implement/implement_scoped_ci.py, src/devops_cli/config/constants.py]
  • Where do ruff format, ruff check and mypy --strict run?: In the step gates, and only when the preset sets step_gates = ruff-mypy. The neutral preset sets none. (best practice) [sources: src/devops_cli/roadmap/implement/implement_step.py, pyproject.toml]
    • Chosen: A preset flag step_gates = ruff-mypy. The gate runs where the tools and their configuration exist.
    • Rejected: Run them for every Python repository. A repository that does not pin the tools fails the gate on the first step.
  • What does the archive step run for a neutral repository?: openspec archive <change> --yes, and only when uses_openspec is true. (best practice) [sources: src/devops_cli/commands/openspec.py, openspec/config.yaml]
    • Chosen: The archive_argv of the preset. The argv comes from the toolchain that the target uses, so no command of devops-cli runs.
    • Rejected: The fixed devops-cli argv. uv run devops openspec archive syncs the environment of the target.
  • What does an unknown toolchain name do?: It raises ConfigurationError that names the file. (best practice) [sources: docs/ERRORS.md]
    • Chosen: Fail closed with ConfigurationError. A typo names its file, so a person corrects it.
    • Rejected: Fall back to neutral. A typo would silently drop every check of the target.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4629

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/feature
    scope/roadmap
    status/new
    value/high
    effort/medium
    on Nov 11, 2026
  3. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P1-High. Owner decision 5 requires implement to run in all 7 repositories, and this preset is the mechanism that makes that possible.
    • Value: High. It unblocks implementation in every target repository by replacing a hard-coded check set with per-repository presets.
    • Effort: Medium. The body estimates about 150 lines, 6 tests and 5 hours of build time.
    • Related: fix(roadmap): a job runs a project step only where the repo has it #3484, which asks for a different change. Both make the implement job adapt to the target repository, but #3484 added a condition for one step while the candidate builds a full preset that selects every check, step gate and archive argv.
  4. added
    priority/p1-high
    on Nov 11, 2026
  5. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 818ac6f while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

  6. added
    status/ready
    and removed
    status/new
    on Nov 11, 2026
  7. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at fbe8984 (see proposed design in issue body).

    Moved to new items: #4785.

  8. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Scope from the issue stewards plan (2026-11-11)

    The issue stewards plan #4780 (child 29) folds this scope into #4635.

    Problem. dotfiles #2 holds 73 repeat comments from a documentation check (docs generate --sync-readme) that does not apply to dotfiles (2026-11-01 to 2026-11-04). The owner rule of 2026-10-20 says that a check that does not apply does not run there.

    Added scope. The documentation check is part of the toolchain preset. A repository with no generated documents runs no documentation check. Add dotfiles #2 as a regression case.

    Added acceptance criterion. A replay of dotfiles #2 runs no documentation check, and posts no "Stopped at docs" or "Cleared the stop at docs" comment.

    This item stays a sub-issue of #4627.

  9. added
    owner/agent
    on Nov 14, 2026
  10. added a commit that references this issue on Nov 14, 2026
    0913e51
  11. added
    status/in-review
    and removed
    status/ready
    on Nov 14, 2026
  12. removed
    status/in-review
    owner/agent
    on Nov 14, 2026
  13. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 23:53 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p1-highscope/roadmapsource/agenttype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions