Skip to content

chore(cli): make campus.audit --json output shapes consistent #61

Closed

Description

@ngjunsiang

Context

The campus audit group (#55) offers --json on most commands, but the
two list-shaped commands return different shapes:

  • campus audit keys list --json prints just the array of key records
    (the server's count is dropped).
  • campus audit traces list --json prints the whole server response,
    including the pagination cursor.

A script that consumes both has to special-case one of them, and the
"which shape is this?" question lands on whoever writes the script.

Proposed fix

Pick one shape for the group and apply it to every --json output. The
server responses are {"api_keys": [...], "count": n} and
{"traces": [...], "cursor": {...}}; printing the server response
verbatim (the traces behaviour) keeps the count and the cursor, and stays
faithful to what the API returns.

Acceptance

  • Every campus audit --json output has the same shape, decided and
    documented in the README.
  • campus audit keys list --json keeps the key count.

Activity

  1. added
    choreSmall task: within 200k tokens, single-PR scope, one service, no semver bump (even patch)
    on Oct 20, 2026
  2. ngjunsiang commented on Oct 20, 2026

    @ngjunsiang
    ContributorAuthor

    Fixed by 0982193, merged to main via PR #55 (campus.audit command group, #54). Verified: full suite green (293 tests, Python 3.11–3.14 CI), ruff clean.

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

    choreSmall task: within 200k tokens, single-PR scope, one service, no semver bump (even patch)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions