Skip to content

feat(gh): gh status, label list and secret list run gh #5228

Open

Description

@dan-petty

Problem or Motivation

The owner asked on 2026-11-12 that a devops command that runs a CLI tool take the names of the tool, and that an API command take the name of its route (#5223, ADR 0026).

  • devops gh status reads the Statuspage summary of githubstatus.com (commands/gh.py). gh status shows the issues, pull requests and notifications of the user. This is the same name with another meaning, and it gives no usage error, so the usage-error records cannot find it.
  • One route kind has three names: devops gh status, devops cloudflare service-status (commands/cloudflare.py) and devops status --service (commands/status_cmd.py). All three read GET /api/v2/summary.json (telemetry/service_status.py).
  • devops gh label list and devops gh secret list take only --repo. gh takes --json, --jq, -L/--limit and -S/--search for labels, and -e/--env, -o/--org and -a/--app for secrets.

Proposed Solution & Architectural Design

  • devops gh status becomes a read entry of the registry of feat(cli): tool commands pass unknown arguments to the tool #5223 for gh status. It meets the four conditions of ADR 0026: one tool command, no owned value, no terminal, and GraphQL inside the trigger. It gets an MCP row, but not in the job roles: under the App identity, the work of the viewer has no meaning.
  • Remove devops cloudflare service-status. devops status --service and its --emit-telemetry become the one path to the Statuspage summaries. Add the hint row cloudflare service-status to the table of feat(cli): usage errors show a hint for known wrong commands #4860; the hint names devops status --service.
  • Premise check, recorded in the proposal:
    • git grep finds no CronJob, workflow or dashboard that runs devops gh status or devops cloudflare service-status.
    • devops status --service --emit-telemetry sends the same gauges.
    • Run gh status with GH_DEBUG=api and record its requests. Set the cost of the entry from that count.
  • devops gh label list and devops gh secret list become read entries. Run each with GH_DEBUG=api, and add a GraphQL verb to CONST_GH_GRAPHQL_PORCELAIN_COMMANDS.
  • label sync, label audit and secret sync stay, because gh has no such verbs.
  • Remove the MCP rows of the removed command. The two list rows get the allowlists of their gh read flags. The spec tool-command-names changes the meaning of status among the gh nouns.

Target Subsystem

SDLC, Git & PR Governance (devops gh), devops cloudflare and devops status.

Existing Tool Considered

The gh commands status, label list and secret list. devops status --service already reads both Statuspage summaries. Nothing is built.

Acceptance Criteria

  • devops gh status --dry-run prints gh status and sends 0 requests. devops gh status prints the output of gh.
  • devops cloudflare service-status exits 2 and prints the hint line.
  • devops status --service --emit-telemetry sends the gauges of both pages (test).
  • devops gh label list --search type --json name --jq '.[].name' and devops gh secret list --json name print the output of gh.
  • --dry-run sends 0 requests.

Dependencies

Merge first: #5223 and #4860 (the hint table). Open the pull request after the pull request of #5227 merges, because both change the generated command reference.

Source: #4833

Alternatives check of 2026-11-29: in-use.
The repository already uses this tool.
Tool: cli/cli (https://github.com/cli/cli), MIT, last activity 2026-11-27, maintained.
Reason: The gh CLI already owns gh status, gh label list and gh secret list with the read flags the issue wants mirrored; the project's devops commands would pass these through, and no ADR rejects the tool.

Covers:

  • gh status shows the viewer's issues, pull requests and notifications
  • label list with search, limit, sort, order, json and jq
  • secret list with env, org, app, json, jq and template
  • Org and exclude filters on status for the viewer's work

Lacks:

  • No label sync or label audit verbs
  • No secret sync verb for sealed secrets
  • Reads no githubstatus.com Statuspage summary
  • No MCP exposure, registry entry or rate-limit cost of its own

Proposed design

Problem statement

devops gh status reads the Statuspage summary of githubstatus.com, while gh status shows the issues, pull requests and notifications of the viewer. One Statuspage route has three command names: devops gh status, devops cloudflare service-status and devops status --service. devops gh label list and devops gh secret list expose only --repo, not the read flags that gh documents. The change makes the three gh commands run gh, removes devops cloudflare service-status with a hint, and leaves devops status --service all (the default) as the one command path to the Statuspage summaries.

Acceptance criteria

Requirement: gh status runs gh

devops gh status SHALL run gh status and print its output unchanged.

Scenario: the output passes through

  • WHEN A test runs devops gh status with the process seam faked so gh status prints a fixed text.
  • THEN The exit code is 0 and stdout holds that fixed text.

Requirement: gh status flags

devops gh status SHALL pass --json, -q/--jq, -o/--org, -e/--exclude and -t/--template to gh status.

Scenario: the status flags reach gh

  • WHEN A test runs devops gh status --json number --org dan-petty --exclude dan-petty/old with the process seam faked.
  • THEN The fake records status with --json number, --org dan-petty and --exclude dan-petty/old, and stdout holds the fake output.

Requirement: gh status dry run

devops gh status --dry-run MUST print the gh status command and send no request.

Scenario: dry run names the gh command

  • WHEN A test runs devops gh status --dry-run with the process seam faked.
  • THEN The exit code is 0, stdout holds gh status, and the fake records no call.

Requirement: cloudflare service-status removal

devops cloudflare service-status SHALL exit 2 and print the hint that names devops status --service all.

Scenario: the removed subcommand gives the hint

  • WHEN A test runs devops cloudflare service-status.
  • THEN The exit code is 2 and stderr holds devops status --service all.

Requirement: status --service telemetry

devops status --service all --emit-telemetry SHALL send one gauge for each Statuspage summary.

Scenario: both pages reach the telemetry sink

  • WHEN A test runs devops status --service all --emit-telemetry with a stub telemetry sink and a stub response for each page.
  • THEN The sink holds one gauge for githubstatus.com and one gauge for the Cloudflare page.

Requirement: label list flags

devops gh label list SHALL pass --json, -q/--jq, -L/--limit, -S/--search, --sort, --order and -t/--template to gh label list, and SHALL refuse --web.

Scenario: the label flags reach gh

  • WHEN A test runs devops gh label list --search type --limit 5 --sort created --order desc --json name --jq '.[].name' with the process seam faked.
  • THEN The fake records label list with --search type, --limit 5, --sort created, --order desc, --json name and --jq .[].name, and stdout holds the fake output.

Requirement: secret list flags

devops gh secret list SHALL pass --json, -q/--jq, -e/--env, -o/--org, -a/--app and -t/--template to gh secret list.

Scenario: the secret flags reach gh

  • WHEN A test runs devops gh secret list --json name --jq '.[].name' --env production with the process seam faked.
  • THEN The fake records secret list with --json name, --jq .[].name and --env production, and stdout holds the fake output.

Requirement: list dry runs

devops gh label list --dry-run and devops gh secret list --dry-run SHALL send no request.

Scenario: a dry run of each list entry

  • WHEN A test runs each list entry with --dry-run and the process seam faked.
  • THEN Each exit code is 0, stdout names the gh argv, and the fake records no call.

Requirement: MCP rows and allowlists

The MCP exposure table SHALL hold read rows for gh status and gh secret list, and the pass-through registry SHALL hold read entries for gh status, gh label list and gh secret list whose mcp_allowlist is a subset of owned_options with a cap, and neither SHALL hold a row for cloudflare service-status.

Scenario: the registries hold the three rows

  • WHEN A test imports CONST_MCP_EXPOSURE_TABLE from src/devops_cli/config/constants.py and REGISTRY from src/devops_cli/core/passthrough.py.
  • THEN It finds the rows for the three commands with their read flags in the allowlists, no cloudflare service-status row, and gh label list keeps its existing row.

Requirement: no job role for gh status or gh secret list

The job-role tables of the tool registry SHALL hold no gh status or gh secret list entry, and gh label list SHALL keep its entry in every job role.

Scenario: the job roles leave the viewer and the secrets out

  • WHEN A test reads the job-role tables of src/devops_cli/roadmap/tools.py.
  • THEN No job role names gh status or gh secret list, and each job role names gh label list.

Requirement: gh status GraphQL cost

_detect_porcelain_resource SHALL return graphql for ('status',), and the gh status registry entry SHALL hold the positive run cost of its recorded request count.

Scenario: the classifier returns graphql

  • WHEN A test calls _detect_porcelain_resource(('status',)) and reads REGISTRY['gh status'].run_cost.
  • THEN The call returns graphql and the cost is positive.

Requirement: generated command reference

The generated command reference SHALL list devops gh status, devops gh label list and devops gh secret list, and SHALL not list devops cloudflare service-status.

Scenario: the docs check passes

  • WHEN A check runs uv run devops ci --check --only docs.
  • THEN The check exits 0 and reports no stale generated document.

Requirement: label sync, label audit and secret sync stay

devops gh label sync, devops gh label audit and devops gh secret sync SHALL stay registered commands.

Scenario: the three commands keep their place

  • WHEN A test runs devops gh label --help and devops gh secret --help.
  • THEN The help lists sync and audit under label, and sync under secret.

Requirement: gh-command-names spec delta

The change SHALL hold a gh-command-names spec delta that gives status among the gh nouns the meaning of gh status.

Scenario: the change validates

  • WHEN A check runs uv run devops ci --check --only openspec.
  • THEN The command exits 0 and reports no error for the change's gh-command-names delta.

Requirement: command-dry-run-class spec delta

The change SHALL hold a command-dry-run-class spec delta that lists nine cloudflare request-plan commands with no cloudflare service-status.

Scenario: the removed command leaves the dry-run class spec

  • WHEN A check runs uv run devops ci --check --only openspec.
  • THEN The command exits 0 and reports no error for the change's command-dry-run-class delta.

Requirement: secret list MCP env parameter

The MCP tool of devops gh secret list SHALL publish its --env value as the parameter environment, so the schema holds no free-text sink name.

Scenario: the environment name is not a sink

  • WHEN A test reads the published schema of the gh_secret_list tool.
  • THEN The schema holds environment and no env parameter, and CONST_MCP_FREE_TEXT_SINK_ALLOWLIST holds no gh_secret_list entry.

Existing Tool Considered

The gh CLI (cli/cli, https://github.com/cli/cli, MIT, maintained). The alternatives check's block records what the tool covers and what it lacks; this change adds no reader of its own and no substitute for the tool, so it states no build cost.

Key questions

  • Which command is the one path to the Statuspage summaries after the change?: devops status --service all (the default when --service is omitted) is the one command path. devops gh status becomes gh status, and devops cloudflare service-status is removed with a hint row that names devops status --service all. The roadmap service's status lane also reads both pages for its scheduled gauges, so no schedule depends on the removed commands. (best practice) [sources: src/devops_cli/commands/status_cmd.py:59, src/devops_cli/commands/status_cmd.py:101, src/devops_cli/commands/cloudflare.py:167, src/devops_cli/commands/gh.py:1631, src/devops_cli/telemetry/service_status.py, src/devops_cli/roadmap/run.py:1182]
    • Chosen: one path: devops status --service all. One route GET /api/v2/summary.json gets one command name, and the option already reads both pages (status_cmd.py:59-61).
    • Rejected: keep devops cloudflare service-status as an alias. Two names for one route keep the ambiguity that the item removes.
    • Rejected: keep devops gh status on githubstatus.com. gh status means another thing in gh, so a usage-error record cannot find it.
    • Rejected: make --service take no value and mean all. The option takes a value today and already defaults to all; changing its arity is larger than the item needs (status_cmd.py:99-102).
  • Does devops gh status become a read entry of the pass-through registry?: Yes. It becomes a read entry for gh status, with an MCP row and no job role. ADR 0037 records the owner rule of feat(cli): tool commands pass unknown arguments to the tool #5223 that a command that runs a tool mirrors its names and options and passes them through, and the registry holds the entry fields. ADR 0026 records GitHub settings as OpenTofu code and names no command, so it is not the source. (best practice) [sources: docs/adr/0037-tool-commands-mirror-and-pass-through-options.md:30, src/devops_cli/core/passthrough.py:50, src/devops_cli/core/passthrough.py:117, src/devops_cli/config/constants.py:306]
    • Chosen: a read entry of the registry. It runs one gh command, holds no owned value, needs no terminal, and its GraphQL request sits inside the trigger (ADR 0037).
    • Rejected: a command with its own implementation. It keeps a second path to the same name.
    • Rejected: a read entry with a job role. Under the App identity the work of the viewer has no meaning (docs/CLUSTER.md:40).
    • Rejected: keep the Statuspage reader under the gh group. That is the name collision that the item removes; devops status --service all holds the read.
  • Which flags do the label list and secret list entries accept?: --repo/-R plus the documented read options of each gh command. gh label list takes --json, -q/--jq, -L/--limit, -S/--search, --sort, --order and -t/--template, and refuses --web. gh secret list takes --json, -q/--jq, -e/--env, -o/--org, -a/--app and -t/--template. The MCP allowlist of each row holds them with a cap. (best practice) [sources: docs/adr/0037-tool-commands-mirror-and-pass-through-options.md:30, src/devops_cli/commands/gh.py:152]
    • Chosen: mirror the documented read flags. ADR 0037 makes the tool's own names and options the contract; the entry adds no devops-owned flag.
    • Rejected: keep --repo only. The entries then lack the filters that gh documents, and a valid gh flag is a usage error.
    • Rejected: add devops-owned flags. A second meaning for a flag that gh defines makes the usage error ambiguous.
    • Rejected: expose --web. --web opens a browser, so it is refused as it is on gh run list.
    • Rejected: leave out --template. It is a read output option like --json and --jq, so leaving it out keeps a usage error.
  • Do label sync, label audit and secret sync stay?: Yes. The gh label group has no sync or audit verb, and the gh secret group has no sync verb. The three commands hold devops-owned logic: the reconciliation of .github/labels.yml, the pull-request taxonomy audit, and the sealed secret sync. They stay as commands and keep their MCP rows. (best practice) [sources: src/devops_cli/commands/gh.py:261, src/devops_cli/commands/gh.py:306, src/devops_cli/commands/gh.py:2050, https://github.com/cli/cli]
    • Chosen: keep the three commands. gh has no verb for them, so the devops command is the only path to the work.
    • Rejected: replace them with gh commands. The gh CLI has no label sync, label audit or secret sync verb (the alternatives block).
  • Do gh label list and gh secret list need a row in CONST_GH_GRAPHQL_PORCELAIN_COMMANDS?: No. gh label list sends a REST GET /repos/{owner}/{repo}/labels request, as the archived check with gh 2.103.2 records, and gh secret list reads the REST route repos/{repo}/actions/secrets that the repository's own secret code uses. Both stay core; a GraphQL row would pace them against points they do not spend. The implementer confirms each with GH_DEBUG=api before the premise check closes. (best practice) [sources: openspec/changes/archive/2026-10-26-1415-graphql-porcelain-pacing/proposal.md:47, src/devops_cli/github/secrets.py:132, src/devops_cli/github/rate_limiter.py:459, src/devops_cli/config/constants.py:3273]
    • Chosen: leave both out of the GraphQL constant. The recorded requests are REST, so the limiter's core class is right.
    • Rejected: add both to the GraphQL constant. A GraphQL row overstates the cost and paces against the wrong quota.
    • Rejected: add only gh label list. Its request is REST, as the archived check records.
    • Rejected: add a row only if GH_DEBUG=api shows /graphql. That is the premise check, not a decision; the recorded check already answers it.
  • How does the rate limiter count the GraphQL cost of gh status?: Add status to CONST_GH_GRAPHQL_GROUPS and not to CONST_GH_GRAPHQL_PORCELAIN_COMMANDS. gh status has a group and no verb, and _detect_porcelain_resource reads the group set before the verb set. Set run_cost from the request count of a gh status run with GH_DEBUG=api. (best practice) [sources: src/devops_cli/github/rate_limiter.py:459, src/devops_cli/github/rate_limiter.py:468, src/devops_cli/config/constants.py:3270, src/devops_cli/config/constants.py:3273]
    • Chosen: add status to CONST_GH_GRAPHQL_GROUPS. The classifier reads the group set first, and gh status has no verb.
    • Rejected: add a ('status', 'status') tuple to CONST_GH_GRAPHQL_PORCELAIN_COMMANDS. gh_command_words gives ('status', None), and the classifier reads the verb set only when the verb is not None.
    • Rejected: classify by a new per-entry field in the registry. It duplicates the constant that the limiter reads and leaves the direct gh path unclassified.
  • Does the removal of devops cloudflare service-status break a schedule or a dashboard?: No. The CronJob template is suspended and runs --version, and no workflow, CronJob or dashboard runs devops gh status or devops cloudflare service-status. The dashboards read the devops_cli_upstream_service_status gauge, which the roadmap service's status lane emits for both pages and which devops status --service all --emit-telemetry also emits. [sources: k8s/devops/cronjob.yaml:22, k8s/devops/cronjob.yaml:51, src/devops_cli/roadmap/run.py:1182, src/devops_cli/roadmap/run.py:1194, k8s/devops/dashboards/project-metrics.json, src/devops_cli/commands/status_cmd.py:78]
  • Does gh secret list join the MCP job roles?: No. It gets an MCP row in the exposure table and a pass-through entry, but no job-role table. The roadmap jobs' App token asks for Actions read and no Secrets read (docs/CLUSTER.md:40), so the row stays in the ops catalogue, as gh status does. (best practice) [sources: docs/CLUSTER.md:40, src/devops_cli/ai/mcp/roles.py:32, src/devops_cli/roadmap/tools.py:151, src/devops_cli/config/constants.py:306]
    • Chosen: MCP row with no job role. The App token of the job roles holds no Secrets read, so the read would fail there.
    • Rejected: MCP row in every job role. The job roles would call a read that their token cannot make.
    • Rejected: no MCP row. The issue asks for an MCP row and the allowlist of its read flags.
  • How does the MCP tool of gh secret list publish --env?: Name the option's parameter environment, as devops gh secret sync does, so the published parameter is environment and not the free-text sink name env. No CONST_MCP_FREE_TEXT_SINK_ALLOWLIST entry is then needed. (best practice) [sources: src/devops_cli/commands/gh.py:2058, src/devops_cli/config/constants.py:634, tests/ai/mcp/test_mcp_tool_secrets.py:194]
    • Chosen: name the parameter environment. The schema publishes environment, which is not a sink name, so the guard passes with no allowlist entry.
    • Rejected: name it env and add an allowlist entry. It needs a reason and publishes a sink name for a value that is only an environment name.
    • Rejected: deny the option. It removes a documented read filter from the MCP tool.
  • Which spec records the gh noun status?: gh-command-names, not tool-command-names; the repository holds no tool-command-names spec. The change's delta updates gh-command-names so status means gh status. [sources: openspec/specs/gh-command-names/spec.md:3, openspec/specs/gh-command-names/spec.md:9]
  • Which specs name cloudflare service-status and must change with its removal?: command-dry-run-class lists it among the ten cloudflare request-plan commands and has a scenario for it. The change's command-dry-run-class delta makes the list nine and removes the scenario. gh-command-names names status and changes as the previous question says. [sources: openspec/specs/command-dry-run-class/spec.md:483, openspec/specs/command-dry-run-class/spec.md:492, openspec/specs/gh-command-names/spec.md:9]
  • Which dependencies still block the change?: Only feat(openspec): openspec validate, list and show run openspec #5227. The pass-through registry of feat(cli): tool commands pass unknown arguments to the tool #5223 and the usage-hint table of feat(cli): usage errors show a hint for known wrong commands #4860 are in the tree: src/devops_cli/core/passthrough.py holds the registry and src/devops_cli/core/usage_hints.yaml holds the hint table, and both changes are archived. feat(openspec): openspec validate, list and show run openspec #5227 changes the generated command reference, so this pull request opens after its pull request merges. [sources: src/devops_cli/core/passthrough.py:117, src/devops_cli/core/usage_hints.yaml:1, openspec/changes/archive/2026-11-25-6597-tool-passthrough-registry/proposal.md:1, openspec/changes/archive/2026-11-25-4860-usage-error-command-hints/proposal.md:1]

Fit

Fits in one pull request.

Suspected block

None.
The item is in a dependency cycle: #5228 → #5227 → #5232 → #5228. A person removes one edge of the cycle, so that its items no longer wait on each other.

Dependencies

#5227

Activity

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

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 90a3d2a 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. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (5)

    Tools considered:

    Searches run:

    • gh CLI status command shows issues pull requests notifications, results: 5
    • gh label list --json --jq --limit --search flags, results: 5
    • cli.github.com manual gh status, results: 5
    • github cli manual gh secret list, results: 5
    • GitHub CLI tool github cli, results: 5

    Sources:

  7. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  8. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

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/p2-mediumscope/ghsource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions