Skip to content

docs: generate gRPC schema reference - #1719

Merged
samuv merged 3 commits into
stacklok:mainfrom
Sanskarzz:feat/grpc-api-docs
Sep 24, 2026
Merged

samuv merged 3 commits into
stacklok:mainfrom
Sanskarzz:feat/grpc-api-docs

Conversation

@Sanskarzz

Copy link
Copy Markdown
Contributor

Summary

  • Generate a Docusaurus-compatible gRPC schema reference from the public
    HarnessService and ScheduleService protobuf contracts.
  • Add task docs:grpc-ref, include it in task docs, and add a non-mutating CI
    freshness check.
  • Link the generated schema from the handwritten gRPC reference and transport
    guide.

Development stage

  • Plan / Interface — Bounded/Architectural behavioral and exact-interface contract; no implementation
  • Implementation — based on an approved, merged Plan / Interface PR
  • Combined — compact one-task Bounded/Architectural exception; no separate plan PR,
    and the in-PR plan declares **Expected tasks:** 1, a non-placeholder
    **Combined rationale:**, and no runtime/public/operator/persistence/trust-boundary
    interface change (None — rationale; workflow-only meta-changes may review process
    docs/skills here)
  • Spike / Routine — acceptance-plan spine exempt; Spike evidence does not ship as-is

Contract linkage

  • Work classification: Routine
  • Classification rationale: Documentation generation and navigation only; no runtime, protobuf, or public API behavior changes.
  • Decision record: None — this adds derived documentation for existing contracts.
  • Human waiver of spine: No
  • Acceptance plan: N/A — Routine work is exempt.
  • Human decisions resolved and recorded: N/A — there are no contract decisions.
  • Plan / Interface PR: N/A
  • Approved commit baseline: N/A
  • Combined/exemption rationale: Routine documentation/tooling change.

Interface conformance

  • The generated page documents the existing public mecatl.v1.HarnessService
    and mecatl.v1.ScheduleService contracts. It does not change those contracts.

Issue relationship

Closes #712

Type of change

  • Behavioral/interface plan
  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation/process
  • Other (describe):

Test plan

Baseline checks

  • Acceptance-plan checker
  • Linting (task lint)
  • Offline test suite (task test)
  • Offline demo (go run ./cmd/mecademo)
  • Markdown changed: docs generation/link checks (task docs)
  • User docs/user-facing behavior changed: site build (task site:build)
  • Guarded engine API affected: compatibility check (task api:check)
  • Intentional engine API change: task api:update + engine/CHANGELOG.md
  • Landed plan: strict acceptance trace (task ac-trace-strict)
  • Final implementation review: /panel-review

The full Go lint/test/demo and engine API gates were not run because this change
does not modify Go code, runtime behavior, or the engine API. Documentation and
workflow-specific gates are listed below.

Additional focused checks:

  • task docs:grpc-ref
  • task lint:actions
  • buf build
  • Non-mutating regeneration and diff of user-docs/reference/grpc-schema.md
  • Source/generated RPC count comparison (88 in both), plus source-type coverage

Changes

File Change
buf.gen.grpc-docs.yaml Pins the Buf-compatible documentation plugin and output.
scripts/grpc-schema.md.tmpl Defines the Docusaurus-safe generated reference format.
user-docs/reference/grpc-schema.md Adds the generated public gRPC schema reference.
Taskfile.yml Adds generation to the normal documentation workflow.
.github/workflows/ci.yml Checks freshness without modifying the checkout.

User-facing change

Readers can look up both public gRPC services, all RPC signatures and streaming
directions, and their messages, enums, fields, and protobuf comments on one
generated reference page.

Special notes for reviewers

The generator intentionally includes only the public Harness and Schedule
contracts. HTTP/OpenAPI/SSE generation remains outside this change and is
tracked separately in #1706. Driver and other internal protobuf contracts are
also excluded.

Descriptions come directly from protobuf comments so the reference cannot
silently diverge from the schema. Some existing comments contain internal ADR,
issue, or implementation references; cleaning those comments would require a
separate protobuf-comment change and is outside #712's no-proto-change scope.

@samuv samuv 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.

Thanks @Sanskarzz! This looks aligned with the narrowed scope of #712. I verified that the reference regenerates consistently and the site builds.

One request: could the message tables show oneof membership? In ConverseRequest, prompt, retry, and the control frames belong to oneof kind, but the current table makes them look independent. protoc-gen-doc exposes this information, so it should be a template change.

I wouldn’t expand this PR to tackle field numbers, map formatting, or cleanup of the proto comments. Thanks again for taking this on!

@Sanskarzz

Copy link
Copy Markdown
Contributor Author

Thanks @Sanskarzz! This looks aligned with the narrowed scope of #712. I verified that the reference regenerates consistently and the site builds.

One request: could the message tables show oneof membership? In ConverseRequest, prompt, retry, and the control frames belong to oneof kind, but the current table makes them look independent. protoc-gen-doc exposes this information, so it should be a template change.

I wouldn’t expand this PR to tackle field numbers, map formatting, or cleanup of the proto comments. Thanks again for taking this on!

Thanks, @samuv. I’ve added a Oneof column to the generated message tables and regenerated the reference. ConverseRequest now shows prompt, retry, and the control frames as members of kind.

I also excluded the synthetic oneofs used internally for protobuf optional fields. I kept field numbers, map formatting, and proto comment cleanup outside this PR’s scope.

task docs and task site:build pass.

@samuv

samuv commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Thanks for the quick update, @Sanskarzz — the oneof column addresses my review comment.

The failing “Docs (matlatl)” job is stopping at the gRPC schema freshness check, before matlatl runs. Since this branch started, #1725 changed harness.proto on main (including removing the old session-migration RPCs and fields). CI includes those newer proto changes, so regenerating the reference there produces a different page from the one committed here. The Docusaurus build passes.

Could you update your branch from main, run task docs:grpc-ref, and commit the regenerated user-docs/reference/grpc-schema.md? That should resolve this drift; no generator change is needed.

@Sanskarzz

Copy link
Copy Markdown
Contributor Author

Thanks for the quick update, @Sanskarzz — the oneof column addresses my review comment.

The failing “Docs (matlatl)” job is stopping at the gRPC schema freshness check, before matlatl runs. Since this branch started, #1725 changed harness.proto on main (including removing the old session-migration RPCs and fields). CI includes those newer proto changes, so regenerating the reference there produces a different page from the one committed here. The Docusaurus build passes.

Could you update your branch from main, run task docs:grpc-ref, and commit the regenerated user-docs/reference/grpc-schema.md? That should resolve this drift; no generator change is needed.

@samuv Please approve and run workflows

@samuv samuv 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.

Thank you, @Sanskarzz. Looks good, so I’ll go ahead and merge this. I’ll follow up with a few visual improvements for the large table.

@samuv
samuv merged commit b1fc5b3 into stacklok:main Sep 24, 2026
38 checks passed
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Sep 25, 2026
2 tasks

This branch was successfully deployed

1 active deployment
Preview — ff55e11d Deployed Sep 23, 2026 by vercel[bot]
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.

Add a generated gRPC API reference

2 participants