Skip to content

fix(docs): generated reference docs fail closed and describe the real surface #854

Closed

Description

@dan-petty

Context & Rationale

devops docs check (ci.yml:63) checks the generated docs as the golden master of the public surface. The generator has four defects:

  1. Errors are swallowed.
    • _introspect_single_group writes 'Error introspecting module: ' as a group's description (docs/generator.py:338-345).
    • _fetch_mcp_tools returns [] on any exception (:388-389).
    • A broken import would therefore be documented, and then checked, as the new contract.
  2. Group-callback options are missing. Options on the callbacks of groups that have subcommands are not rendered. devops ci --fix/--check/--files and devops review --explain appear in no committed doc.
  3. MCP parameter detail is lost. MCP_TOOLS.md drops the array item types (13 parameters) and the enum values (1 parameter) (_extract_mcp_prop_type, :122-131).
  4. Wrong config file name. CONFIGURATION.md:8 tells users to create .devops-cli.yaml, hardcoded at generator.py:712. The loader searches config.yaml, .devcontainer/config.yaml, .devops/config.yaml, .devops.yaml and .devcontainer/.devops.yaml (config/settings.py:868-880).

Also, Settings ignores unknown keys (extra='ignore', settings.py:227, 348, 367, 564, 593), and no test loads config.example.yaml.

Scope & Deliverables

  • Deliverable:
    • Remove both catch-and-continue branches, so any introspection failure fails the docs commands and names the module.
    • Render group-callback options, array item types and enum values.
    • Render the project-config file candidates from the constant that _find_project_config_path uses, moved to config/constants.py.
    • A test walks config.example.yaml and asserts that every key path maps to a Settings field, following nested models and aliases. It then validates the file with Settings.model_validate.
    • Regenerate the docs.
  • Acceptance criteria:
    • A forced import failure makes generate_all_docs raise.
    • A forced MCP listing failure makes MCP doc generation raise.
    • docs/commands/ci.md lists --check.
    • MCP_TOOLS.md shows the item types and the enum values.
    • CONFIGURATION.md lists exactly the files the loader searches.
    • An unknown key in a copy of the example config fails the test and names the key path.
    • devops docs check passes, the docs stage takes no longer than noise, and the new tests take at most 1 s.
  • Key questions:
  • Constraint: The error message must say that a missing optional dependency now fails the docs stage, by design.

Strategic Alignment

  • Milestone: Backlog
  • Depends on: none

Update 2026-10-08: refinement

docs/CONFIGURATION.md:8 still omits the two .devcontainer/ files the loader searches (config/settings.py:1095-1101), and the list is literal (docs/generator.py:756-758). Defects 1-3 hold.

  • (replaces the --check criterion, which passes for the wrong reason) docs/commands/ci.md has an options table for devops ci listing --check, --only and --skip.

Activity

  1. added
    type/bug
    scope/cli
    priority/p2-medium
    on Oct 1, 2026
  2. added
    scope/docs
    on Oct 2, 2026
  3. dan-petty commented on Oct 2, 2026

    @dan-petty
    OwnerAuthor

    Fact-check (2026-10-02), more findings in the generated docs/CONFIGURATION.md and docs/ERRORS.md. A second agent re-checked each one and confirmed it false at the release/v0.2.25 tip. Both files come from docs/generator.py (generate_configuration_docs, generate_error_catalog_docs), so the fix belongs in the generator, alongside item 4 here:

    • docs/CONFIGURATION.md:8 (high): 3. Local Project Configuration (.devops-cli.yaml) → 3. Local Project Configuration ($DEVOPS_CLI_CONFIG, else the first config.yaml, .devcontainer/config.yaml, .devops/config.yaml, .devops.yaml or .devcontainer/.devops.yaml found up to the repo root). Fix the text in generator.py:709 too, or the next regeneration brings it back.
    • docs/CONFIGURATION.md:54 (low): Kubernetes cluster connection, Minikube, Helm, and Kustomize settings. (also line 42: "OpenTelemetry distributed tracing and Prometheus metric export settings.") → k8s: "Kubernetes context, ingress domain, and service addressing settings." telemetry: "OpenTelemetry export and Logfire settings." Have the generator iterate over Settings.model_fields rather than a hard-coded list.
    • docs/ERRORS.md:3 (medium): canonical machine-readable error codes, POSIX exit status codes, ... for all exceptions inheriting from DevOpsCLIError (Exit Code column, e.g. ModelUnavailableError ... 12, AgentRunError ... 20, KeyringUnavail → **Add under the matrix: "The Exit Code column is the exception's exit_codeattribute. Onlydevops cloudflare, devops valkeyanddevops sandbox` exit with it today; other commands exit 1 when one of these exceptions escapes." Alternatively, apply cli_command_handler to every command.**
    • docs/ERRORS.md:4 (low): for all exceptions inheriting from DevOpsCLIError → Add the row "| MemoryOperationConflictError | HARNESS_EXECUTION_ERROR | 1 | ... |". Better, have the generator import every package before it walks the subclasses.
    • docs/ERRORS.md:12 (low): | 2 | CONST_EXIT_USAGE | ... | 130 | CONST_EXIT_CANCELLED | ... → | 2 | - (click usage error) | ... | 130 | - (typer, on KeyboardInterrupt) | ...; or define the two constants in constants.py.
    • docs/ERRORS.md:98 (medium): | SecretExposureError | SecretExposureError | 1 | Security | ... (also line 35 ChecksumMismatchError | ChecksumMismatchError | 1, and line 107 ToolDownloadError | ToolDownloadError | 1) → | ChecksumMismatchError | CHECKSUM_MISMATCH | 1 | ...; | SecretExposureError | SECRET_EXPOSURE_DETECTED | 4 | ...; | ToolDownloadError | TOOL_DOWNLOAD_ERROR | 1 | .... Fix it in generator.py by building each class with its required arguments.
  4. added this to the v0.2.36 milestone on Oct 14, 2026
  5. dan-petty commented on Oct 14, 2026

    @dan-petty
    OwnerAuthor

    Moved to v0.2.36: v0.2.36 started with fewer than its 16 items and was topped up to 16 from Ready items, critical fixes and P0 features first. (devops roadmap reprioritize)

  6. added
    status/in-progress
    on Oct 16, 2026
  7. dan-petty commented on Oct 16, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1591, merged into release/v0.2.36 as 13ae238.

    Closes #854

    16 file(s) changed.

    How it was verified

    Check runs at 9282d7d:

    • Prune PR DevContainer Images: pass
    • Audit Defect PR Hardening: skipping
    • devops-cli: pass
    • bandit: pass
    • CodeQL: pass
    • Changed-Test Independence: pass
    • Tests & Coverage: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Static Analysis: pass
    • Dependency Freshness: skipping
    • Service Image: skipping
    • DevContainer Image: skipping

    Acceptance Criteria of docs/agent/tasks/task-854-reference-docs-fail-closed.md:

    No Acceptance Criteria section.

  8. added a commit that references this issue on Oct 17, 2026
  9. removed
    status/in-progress
    on Oct 30, 2026
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

    priority/p2-mediumscope/cliscope/docstype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions