Skip to content

ci: report what a new OpenShell release adds to the API, and audit coverage - #150

Open
Gkrumbach07 wants to merge 4 commits into
ai-openshell:mainfrom
Gkrumbach07:claude/api-coverage-audit-ab5d11
Open

Gkrumbach07 wants to merge 4 commits into
ai-openshell:mainfrom
Gkrumbach07:claude/api-coverage-audit-ab5d11

Conversation

@Gkrumbach07

Copy link
Copy Markdown
Contributor

Problem

Nothing told this project when upstream added something that broke nothing. SuspendSandbox, ResumeSandbox and two sandbox phases came with OpenShell 0.1.6 and were found by accident. There was also no record of how much of the gateway's user-facing API the dashboard offers.

Change

The alert. The Follow upstream plan step now compares the gateway's user-facing API at the pinned release and at the target, and says what is new: RPCs, fields and enum values, added, removed or changed. The report goes in three places: the bump pull request's description, the run summary, and check A's issue.

  • It reads openshell.proto and what it imports from a shallow clone of each tag. No copy of the protos is kept here (ADR 0003).
  • User-facing means the RPC's authorization rule admits a user: bearer, dual or unauthenticated. Sandbox, peer and operator RPCs are listed apart.
  • Each new RPC and request field is looked up in a coverage ledger. What the ledger does not list is searched for in frontend/src and backend/pkg; a name that occurs is reported as a hint, not as covered.
  • It decides nothing. Protos that cannot be fetched or parsed do not stop a bump or check A; the report then says the comparison is missing and gives the command to run by hand.
  • No workflow file changes: plan already has git and the network.
python3 deploy/ci/upstream/follow.py api-diff --from 0.1.5 --to 0.1.6
python3 deploy/ci/upstream/follow.py api-coverage [--write] [--upstream]

The audit. docs/api-coverage.md covers the pinned release, 0.1.9: all 69 user-facing RPCs and all 505 fields a client can send, each with whether the SDK and the BFF carry it and how the UI offers it. Its counts and tables are generated from deploy/ci/upstream/api-coverage.json, and a unit test fails when the two disagree.

RPCs offered as something a person can do 39 of 69
RPCs with nothing in the dashboard 12
Authorable fields with an input 35% of 353
Authorable fields reachable only as YAML or JSON 30%
Authorable fields the dashboard cannot send 23%

The page also ranks the gaps, explains why the Create provider profile form was refused by the gateway (the fix is #149), and lists the compat probes that would have caught it.

What the alert says for 0.1.5 → 0.1.6

OpenShell 0.1.5 → 0.1.6: 2 new RPCs, 2 new fields in what it returns, 2 new enum values, 2 new messages.

RPC Who may call it What it does Dashboard
ResumeSandbox workspace user (sandbox:write) Restore a suspended sandbox in a new runtime generation. not offered
SuspendSandbox workspace user (sandbox:write) Freeze a ready sandbox and retain its memory state for a later resume. not offered

It also lists SANDBOX_PHASE_SUSPENDING and SANDBOX_PHASE_SUSPENDED as named nowhere in the dashboard's source.

Testing

  • Unit tests: 77 new, for the parser, the comparison, the ledger and the wiring into the plan, the pull request body and the command line. The whole deploy/ci/upstream suite passes (377).
  • Against the real upstream: api-diff for 0.1.5 → 0.1.6 over the network gives the same report as from a local clone. A dry-run plan targets 0.1.10-pre.3 and renders a pull request body with the API section (six new RPCs, the workspace secrets).
  • The ledger was checked against upstream's protos at v0.1.9 with api-coverage --upstream: every user-facing RPC and request field is classified.
  • The audit's findings are read from the code, except the profile form's refusals, which were measured on a 0.1.6 gateway with read-only lint calls. Nothing was run against a 0.1.9 gateway. The page marks which is which.

Not in this change

  • No CI job fails on an unclassified RPC. api-coverage --upstream can do that on bump pull requests; whether it should is a decision left open (see "Not done" in deploy/ci/upstream/README.md).
  • The comparison reads protos, not behaviour: a release that starts refusing something the forms send, with no proto change, is not in it.
  • No gap is fixed here. If fix(profiles): let the profile form make a credentialed endpoint #149 merges first, the ledger entries for ProviderProfile.endpoints and ImportProviderProfiles and the profile-form section of the page need updating in this branch.

🤖 Generated with Claude Code

@danreed-rh danreed-rh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The audit and release-reporting workflow are valuable. One part of the alert's stated scope is still missing: fields in newly added request messages are listed by name but never checked for dashboard coverage. I'd fix that before merge. The import and enum cases below are worthwhile follow-ups, but I would not hold this PR for them without evidence that a supported release is affected.

if changes:
out["rpcs_changed"].append({"rpc": key, "changes": changes})

for name in sorted(set(new["messages"]) - set(old["messages"])):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we pass fields of new request messages through the new-field coverage check? Today ResumeSandboxRequest.restart_if_restore_fails appears in the message’s field list, but it never enters fields_added or gets a ledger/source annotation. The PR says each new request field is checked, and #151’s planned ledger update will not change this reporting path.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9eab73b. diff() now lists every field of a new message a client sends as message_fields_added. annotate() looks each one up the way it does any other new field: ledger first, then the source search. The report gives them a table of their own, "Fields of new messages a client can send". Fields of a new message that only the gateway returns stay listed with the message.

On the real 0.1.5 → 0.1.6 diff, ResumeSandboxRequest.restart_if_restore_fails now appears with the ledger's answer (not offered, until #151 updates the ledger). There are new tests for the listing, for leaving response-only messages out, for the ledger and source annotation, and for the table.

I left the import-error and enum-renumbering suggestions for a follow-up, as you suggested.

🤖 Addressed by Claude Code

name = queue.pop(0)
if name in files or name.startswith("google/"):
continue
text = read(name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a non-Google import cannot be read, could this raise ProtoError instead of skipping it? The comparison can otherwise succeed with messages and fields missing. plan.api_changes() already catches ProtoError and produces the intended non-blocking “Not compared” report. I have not found evidence that the releases tested in this PR hit this case.

out["enums_added"].append(
{"enum": name, "values": sorted(new["enums"][name]["values"]), "used_in": sorted(uses.get(name, []))}
)
for name in sorted(set(old["enums"]) & set(new["enums"])):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could a follow-up compare numbers for enum values present in both releases? Renumbering a value currently produces no change, even though its wire value changed. I don’t see an affected upstream release in this PR, so this need not hold the audit and alert work.

Gkrumbach07 and others added 4 commits December 2, 2026 12:27
…verage

Nothing told this project when upstream added something that broke nothing:
SuspendSandbox, ResumeSandbox and two sandbox phases came with OpenShell
0.1.6 and were found by accident.

The Follow upstream plan now reads the gateway's user-facing API from the
protos of the pinned release and of the target (a shallow clone of each tag;
no copy is kept here) and says what is new: RPCs, fields and enum values,
added, removed or changed. The report goes in the bump pull request's
description, the run summary and check A's issue. It informs and decides
nothing: protos that cannot be fetched or parsed do not stop a bump, and the
report then says the comparison is missing and how to make it by hand.

  follow.py api-diff --from 0.1.5 --to 0.1.6     the same report by hand
  follow.py api-coverage [--write] [--upstream]  check the ledger and its document

protoapi.py parses the proto3 upstream uses and keeps the RPCs whose
authorization rule admits a user (bearer, dual, unauthenticated), with every
message and enum they reach. apidiff.py compares two releases and looks each
new thing up in the coverage ledger, then in the dashboard's source.

docs/api-coverage.md is the audit at the pinned release, 0.1.9: all 69
user-facing RPCs and all 505 fields a client can send, each with whether the
SDK and the BFF carry it and how the UI offers it. It is generated from
deploy/ci/upstream/api-coverage.json, and the unit tests fail when the two
disagree. 39 RPCs are offered, 12 are not. Of the 353 fields a person could
author, 35% have an input, 30% can be set only in a YAML or JSON document and
23% cannot be sent. The page ranks the gaps, says why the Create provider
profile form cannot make a profile the gateway accepts (measured on 0.1.6),
and lists the compat probes that would have caught it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Gage Krumbach <gkrumbac@redhat.com>
PR 149 gives the Create provider profile form a protocol, an access preset
and the allow-uninspected checkbox per endpoint. The page describes main
without it; say so, and what to update when it merges.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Gage Krumbach <gkrumbac@redhat.com>
The alert said every new request field is looked up in the coverage
ledger, but a field of a message that is itself new was only named in
the message's field list: ResumeSandboxRequest.restart_if_restore_fails
never reached the ledger or the source search.

diff() now lists every field of a new message a client sends as
message_fields_added, annotate() looks each up like any other new
field (ledger first, then the source), and the report gives them a
table of their own. Fields of a new message only the gateway returns
stay listed with the message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Gage Krumbach <gkrumbac@redhat.com>
ai-openshell#149

ai-openshell#149 merged on 2026-11-30: each endpoint of the Create provider profile
form now picks REST or WebSocket with an access preset, or plain TCP with
allow_uninspected_credentials. The ledger still called the form broken
and pointed at lines the change moved.

The ledger entries for ImportProviderProfiles and ProviderProfile.endpoints
now say what the form sends, every CreateProfileModal.tsx location is the
line it is at on main, and the page's ranked gaps and profile-form section
say what ai-openshell#149 fixed and what is still to do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Gage Krumbach <gkrumbac@redhat.com>
@Gkrumbach07
Gkrumbach07 force-pushed the claude/api-coverage-audit-ab5d11 branch from 9eab73b to 285c83b Compare December 2, 2026 18:30

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants