Skip to content

fix(docs): ci docs cannot pass in another repository's runner #7983

Done

Description

@dan-petty

Problem

A plan for another repository names uv run devops ci docs as a verification, and the implement job cannot pass it there. devops ci docs runs devops docs check, which generates the documents of devops-cli into the checkout and imports each module of devops-cli.

Evidence

On 2026-11-30 the implement run of dan-petty/homelab#353 on the runner image v0.265.3 stopped at group 1 after 7 attempts and 6 repair rounds, with about 4.6 million input tokens, as ci_infra:

RuntimeError: Failed to import module 'devops_cli.grafana.service_dashboard' for the error catalog: No module named 'grafana_foundation_sdk'. A missing optional dependency now fails the docs stage, by design.

The failure does not depend on the change of the item, so no repair round can pass it.

Expected

The docs check of another repository judges the documents of that repository only, or the plan checks refuse the command for it. A check that cannot run stops the item before the repair rounds.

Proposed design

Problem statement

Plans for a managed repository other than devops-cli can name uv run devops ci docs. That command generates the devops-cli documents and imports the devops-cli modules in the target checkout. It fails on a missing optional dependency or on the target documents. A homelab checkout at main exits 1 with 32 findings even when each optional package is installed. No repair round can pass the command. The change makes the stage gate refuse the command before the implement job starts.

Acceptance criteria

Requirement: Refuse cross-repository docs check

The stage gate SHALL refuse a plan that names devops ci docs for a repository with no path under src/devops_cli/.

Scenario: Plan for homelab names ci docs

  • WHEN A stage plan for a repository with no path under src/devops_cli/ names uv run devops ci docs in its verify commands.
  • THEN The stage gate returns a finding with code stage_problem_cross_repo_docs_check and refuses the plan.

Requirement: Refuse underlying docs check command

The stage gate MUST refuse devops docs check in a plan for a repository with no path under src/devops_cli/.

Scenario: Plan names docs check

  • WHEN A stage plan for a repository with no path under src/devops_cli/ names uv run devops docs check.
  • THEN The stage gate returns the same stage_problem_cross_repo_docs_check finding and refuses the plan.

Requirement: Accept docs check for devops-cli

The stage gate SHALL accept devops ci docs in a plan for a repository with a path under src/devops_cli/.

Scenario: Plan for devops-cli names ci docs

  • WHEN A stage plan for a repository with a path under src/devops_cli/ names uv run devops ci docs.
  • THEN The stage gate returns no finding for that command.

Requirement: Name the command and repository

The finding SHALL contain the refused command and the target repository.

Scenario: Finding text names the command

  • WHEN The stage gate refuses uv run devops ci docs for dan-petty/homelab.
  • THEN The finding message contains devops ci docs and dan-petty/homelab.

Requirement: Stop before the implement job

A plan that the gate refuses for the cross-repository docs command MUST open no draft pull request.

Scenario: No draft for refused plan

  • WHEN The stage gate refuses the plan for the cross-repository docs command.
  • THEN The stage job opens no draft pull request for the item and the implement job receives no item.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers a project-specific plan gate for devops-cli commands. The change adds one rule to the existing stage gate and uses its existing git ls-files list. The written cost is about 20k tokens and 2 hours to build, keep and fix the rule.

Key questions

  • Where must the rule stop the cross-repository docs command?: The stage gate must refuse the plan before it opens a draft and before the implement job starts. (best practice) [sources: docs/CLUSTER.md:56, docs/CLUSTER.md:57, CONTEXT.md]
    • Chosen: Stage gate rule. The stage job checks a plan before it opens a draft, so a refusal stops the item before the implement job and its repair rounds.
    • Rejected: Implement job check. The implement job runs after model steps and repair rounds, so the failure costs tokens before the check stops it.
    • Rejected: Change devops docs check. The command generates devops-cli documents by design, and a change to it risks the devops-cli docs.
  • How does the stage gate identify a repository that cannot run the devops-cli docs check?: The gate reads the tracked files of the target commit. It treats a repository with no path under src/devops_cli/ as another repository. (best practice) [sources: docs/CLUSTER.md:56]
    • Chosen: Tracked file list. The stage job already reads the tracked files of the commit for path checks, so the rule adds no new setting or request.
    • Rejected: Project profile type. The type of a project does not prove that the devops-cli package is in the target checkout.
    • Rejected: Hardcoded repository name. A fork or a renamed repository breaks the rule.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    scope/docs
    source/agent
    status/new
    effort/medium
    value/high
    on Dec 1, 2026
  2. dan-petty commented on Dec 1, 2026

    @dan-petty
    OwnerAuthor
    • Priority: The implement job cannot pass in another repository, causing service jobs to fail.
    • Related: fix(roadmap): a job runs a project step only where the repo has it #3484, which asks for a different change. Both address docs commands running in the wrong repository context, but #3484 fixed docs generate while the candidate addresses docs check importing devops-cli modules.
  3. added
    priority/p0-critical
    on Dec 1, 2026
  4. dan-petty commented on Dec 1, 2026

    @dan-petty
    OwnerAuthor

    Two more facts, from 2026-12-01:

    • devops docs check in a checkout of dan-petty/homelab at main, with each optional package of devops-cli installed, exits 1 with 32 findings (unknown commands, options, setting keys and variables in k8s/README.md). No generated document differs and no import fails. So the command fails on the unchanged default branch, whatever the runner image holds.
    • 11 of the 21 active changes in openspec/changes/ of homelab name devops ci docs in tasks.md.
  5. added
    owner/agent
    on Dec 1, 2026
  6. dan-petty commented on Dec 1, 2026

    @dan-petty
    OwnerAuthor

    A fact that the design of the fix depends on (read on 2026-12-01 from the comment of dan-petty/homelab#361 of 00:48:16Z and its trace):

    • Groups 1 and 2 passed. Group 3 stopped after 7 attempts on uv run devops ci docs, with about 31.6 million input tokens, as plan_defect with the action left wait.
    • So a new run of that item starts from a branch that holds work. The proof of the command must run on the base commit, and not only on a branch with no work.
    • The agent saw the failure on the unchanged files and asked to amend the plan. The job refused the new command, because it does not start with uv run devops.
    • The trace holds the 7 attempts and no message of the agent. So the turn of its first request is not verified. The code reads a request only after the repair rounds are spent.

    The pull request covers both: it proves an undeclared documents check on the base commit, and a plan request in a turn that leaves a verification command failing ends the rounds.

  7. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  8. added
    status/in-progress
    and removed
    status/new
    on Dec 1, 2026
  9. removed
    status/in-progress
    owner/agent
    on Dec 1, 2026
  10. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Live since 2026-12-01 02:48 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/p0-criticalscope/docssource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions