Skip to content

fix(docs): the docs check validates the options inside optional-group brackets such as [-v <ver>] #1299

Closed

Description

@dan-petty

Problem

Copilot thread 3 on #1283, verified at 61f9b67. markdown_argv_collector treats any token that starts with [ or ends with ] as a placeholder [code: src/devops_cli/docs/markdown_argv_collector.py:35], so a bad option written inside brackets escapes the check. Requiring a matched pair, as suggested, would break RELEASE_CYCLE.md:142-145, where [-v <ver>] splits into [-v and <ver>]. It came in with #921 (bfd4229).

Acceptance criteria

  • The check strips optional-group brackets and validates the option inside, so [-v <ver>] passes and [--no-such-flag] fails. Tests cover both.
  • changelog.d/<n>.md records the change; CHANGELOG.md and docs/ROADMAP.md are not edited.
  • uv run devops ci passes.

Strategic alignment

Activity

  1. added
    type/bug
    priority/p3-low
    scope/docs
    on Oct 7, 2026
  2. added this to the v0.2.30 milestone on Oct 8, 2026
  3. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to v0.2.30: a critical fix can join v0.2.30 after it starts.

    • Priority: P0-Critical. P0: the regression commit bfd4229 is evidence GitHub confirms, from a trusted source.
    • Value: Medium. Closes a hole in the docs-check gate so invalid options inside optional groups are caught before release.
    • Effort: Low. The fix is localized to one function in markdown_argv_collector.py plus two test cases, as the body specifies.
  4. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1458, merged into release/v0.2.30 as 6b65810.

    Summary

    • devops docs check now validates an option written inside synopsis optional-group brackets ([-v <ver>], [--json]). It used to skip it as a placeholder, so a misspelled option such as [--no-such-flag] passed the check.
    • _tokenize_command in src/devops_cli/docs/markdown_argv_collector.py now maps each word through a new _argv_token. It strips one leading [ and one trailing ], and a word that then starts with - is that option. Every other word keeps the existing is_placeholder mapping, so <ver>], INT], [OPTIONS] and [ARGS]... stay placeholders. A matched-pair rule was rejected because shlex splits [-v <ver>] into [-v and <ver>].
    • The -p/-v options in the devops release table of RELEASE_CYCLE.md are now checked, and they resolve. All checked docs stay at 0 findings.
    • Updated the two lines of docs/agent/tasks/task-921-docs-name-only-what-exists.md that this change made stale. Added changelog.d/1299.md and docs/agent/tasks/task-1299-docs-check-validates-optional-group-options.md.

    Closes #1299

    5 file(s) changed.

    How it was verified

    Check runs at 54fe3ec:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • Service Image: skipping
    • DevContainer Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1299-docs-check-validates-optional-group-options.md:

    • [-v <ver>] resolves with -v checked as an option, and [--no-such-flag] is reported as an unknown option: test_an_option_in_optional_group_brackets_is_validated in tests/test_docs_knowledge_base_argv.py.
    • changelog.d/1299.md records the fix under ### Fixed. CHANGELOG.md and docs/ROADMAP.md are not edited.
    • uv run devops ci passes.
  5. added a commit that references this issue on Oct 9, 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/p3-lowscope/docstype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions