feat(db): add example values to all protobuf schemas#23
feat(db): add example values to all protobuf schemas#23cooper (czxtm) wants to merge 1 commit intomainfrom
Conversation
Adds `example` annotations to every field across the 18 schemas that were missing them (apps, aws, config, databases, deployment, extensions, files, healthchecks, modules, onboarding, scripts, secrets, services, shells, sst, step-ca, tasks, variables) so the studio can surface realistic placeholders and downstream tooling has a single source of truth for sample values. Threads examples through the existing buf-gen pipeline by appending `(example: ...)` to each field's proto comment in `proto.nix`'s renderer. String examples are JSON-escaped so embedded quotes/newlines (INI fragments, JSON snippets) don't break proto3 syntax. `protobuf-ts` preserves these comments, so the generated TypeScript .d.ts files now carry examples as JSDoc — visible in the studio without a separate fixtures pipeline. Verified end to end: - `packages/proto/generate.sh proto` regenerates all 26 .proto files cleanly with `(example: ...)` annotations - `buf generate` succeeds; examples surface in `packages/proto/gen/ts/*_pb.d.ts` JSDoc - `bun apps/web/scripts/demo-smoke.ts` exercises the demo agent's MSW handlers and confirms `/health`, `/api/state`, `/api/nix/data?entity=apps`, and `/api/process-compose/processes` return the expected fixture data (11/11 assertions pass) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PR SummaryMedium Risk Overview Regenerates Go protobuf bindings to include these examples in doc comments (and adds a new optional Reviewed by Cursor Bugbot for commit e055f9c. Configure here. |
|
Preview deployed to |
|
Docs preview deployed to |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue. You can view the agent here.
Reviewed by Cursor Bugbot for commit e055f9c. Configure here.
| // the variable is missing. | ||
| // | ||
| // (example: "Postgres connection string used by the API server") | ||
| Description *string `protobuf:"bytes,7,opt,name=description,proto3,oneof" json:"description,omitempty"` |
There was a problem hiding this comment.
Undocumented protobuf message shape change in EnvironmentVariable
Medium Severity
The proto regeneration adds a new Description field (proto field 7, oneOf index 3) to the EnvironmentVariable Go struct and raw descriptor. The old generated code only had fields 1–6; now field 7 is materialized with a new GetDescription() accessor and an updated rawDesc. This is a real protobuf wire-format and JSON-serialization change — not just a comment update — despite the PR description explicitly claiming "no changes to message shapes or field numbers." Consumers deserializing EnvironmentVariable will now see a description key in JSON output when set, which could break snapshot tests or downstream expectations.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit e055f9c. Configure here.
There was a problem hiding this comment.
Bugbot Autofix determined this is a false positive.
Comparing this branch to its base shows no diff in packages/proto/gen/gopb/apps.pb.go, and EnvironmentVariable.description already exists in both, so this PR does not introduce the reported message-shape change.
You can send follow-ups to the cloud agent here.


Summary
examplevalues to every field across the 18 protobuf schemas that were missing them (apps,aws,config,databases,deployment,extensions,files,healthchecks,modules,onboarding,scripts,secrets,services,shells,sst,step-ca,tasks,variables).proto.nixnow appends(example: ...)to each field's proto comment, with strings JSON-escaped so embedded quotes/newlines don't break proto3 syntax.protobuf-tscarries those comments through to TypeScript JSDoc, so the studio (and any consumer of the generated.d.ts) gets examples for free — no separate fixtures pipeline.apps/web/scripts/demo-smoke.ts— a standalone Bun smoke test that drives the studio's MSW-backed demo agent directly and verifies/health,/api/state,/api/nix/data?entity=apps, and/api/process-compose/processesreturn the expected fixture data.Why
The studio panels and forms benefit from realistic placeholder values, and the protonix schema is the natural place to author them once and have them flow to TS, Go, and JSON Schema outputs together. Threading them through the existing
.protocomment path means we don't introduce a new generation pipeline or proto extension —buf generatealready preserves comments as JSDoc.Reviewer notes
apps/stackpanel-go/internal/agent/server/connect_entities_gen.godiff is a reordering of generated handler methods (it falls out ofbuf generateafter the proto regeneration) and contains no semantic changes.theme.proto.nixschema already used the newproto.mkField-styleexample = ...; the new schemas use the legacy positional API viaproto.withExamplesince most schemas in the codebase use that style. Both APIs converge inproto.mkFieldand produce identical proto output.Test plan
bash packages/proto/generate.sh proto— all 26 protos regenerate cleanly,(example: ...)annotations presentbuf generate(inpackages/proto/) — succeeds, examples flow intopackages/proto/gen/ts/*_pb.d.tsJSDocbun apps/web/scripts/demo-smoke.ts— 11/11 assertions pass against the demo agent's MSW handlers/demoroute in the studio (manual)🤖 Generated with Claude Code