Skip to content

fix(ai): devops ai agents detects the project manifest #4641

Closed

Description

@dan-petty

Problem Description

  • ProjectMetadata sets requires_python to '>=3.14' by default, and the check commands to uv run pytest, uv run ruff check and uv run mypy src (src/devops_cli/ai/instruction_generator.py:86 and :93-95, src/devops_cli/config/defaults.py:639-645).
  • generate_agents_md for a folder with only Cargo.toml writes "It runs on Python >=3.14" and those 3 commands.
  • parse_project_metadata reads only pyproject.toml.
  • AGENTS.md.j2 has 11 rules and AGENTS.md has 14, and no test finds the drift.
  • The model path uses the ARCHITECT review persona as its system prompt (src/devops_cli/commands/ai.py:909).
  • 5 of the 6 other repositories have no AGENTS.md.

Reproduction Steps

  1. Make a folder that holds only a Cargo.toml.
  2. Run uv run devops ai agents in that folder.

Expected vs Actual Behavior

Expected: the AGENTS.md names the Rust toolchain or no toolchain, and no check that the folder cannot run.
Actual: the AGENTS.md says that the project runs on Python >=3.14 and lists uv run pytest, uv run ruff check and uv run mypy src.

Proposed Solution & Architectural Design

  • Detect the manifest (pyproject.toml, Cargo.toml, package.json or go.mod). Render the toolchain line only for the manifest that exists, and none when there is no manifest.
  • Take the check line only from the pre-push hooks. Write none when there are no hooks. Remove DEFAULT_AGENTS_MD_CHECK_COMMANDS.
  • Render rule 4 (devops ci fail-to-pass, pytest) only for Python.
  • Add a plan-system slot: the OpenSpec text renders only when openspec/config.yaml exists.
  • Give the model path its own short system prompt.
  • Add a test that compares the rule titles of the template with those of AGENTS.md, less a named list of the rules that only devops-cli has. Do not add a byte-equal test, because AGENTS.md has 6,498 of the 6,500 allowed characters.

Target Subsystem

AI & Agentic Review Pipeline (src/devops_cli/ai/instruction_generator.py).

Existing Tool Considered

The template is Jinja2, which stays. The kit item (#3753) moves the template into the Copier project kit later. The manifest detection reads 4 standard file names. No tool is necessary. Cost: about 50 lines and 4 tests, about 200,000 tokens and 2 hours to build.

Acceptance Criteria

  • A test: a Cargo-only folder gives an AGENTS.md with no "Python", "uv", "pytest", "ruff" or "mypy".
  • A test: a folder with no manifest and no hooks gives no toolchain line and no check line.
  • A test: devops-cli renders the same check line as today (from its hooks).
  • The rule-title test fails when a rule title is added to AGENTS.md and not to the template or the named list.
  • git grep -n DEFAULT_AGENTS_MD_CHECK_COMMANDS src gives 0.

Dependencies

None.

Source: #4627

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/bug
    scope/ai
    status/new
    value/medium
    effort/low
    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/bug. The fix prefix of the title gives the type.
    • Scope: scope/ai. The (ai) scope of the title gives the scope.
    • Priority: P2-Medium. The tool emits wrong toolchain and check lines for every non-Python project, but it does not crash or lose data.
    • Value: Medium. Users of Rust, Go, or JS projects receive an AGENTS.md that names a Python toolchain they do not use.
    • Effort: Low. The body estimates about 50 lines of code and 4 tests, roughly 2 hours of work.
    • Related: feat(ai): validate devops ai tooling across the sample repositories #505, which asks for a different change. Both concern devops ai tooling working correctly on non-Python projects, but #505 asks for a validation run across sample repos while the candidate fixes the manifest detection logic in the AGENTS.md generator.
  4. added
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 11, 2026
  5. removed
    status/in-review
    owner/agent
    on Nov 11, 2026
  6. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-11 22:57 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/lowpriority/p2-mediumscope/aisource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions