Repository navigation
feat(cli): add selected stream metadata - #88
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 35 files
Shadow auto-approve: would not auto-approve because issues were found.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 11 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would auto-approve. Adds optional output.stream.metadata to CLI generation, reporting a selected field on stderr after clean completion, with validation, templates, and CLI-target tests/docs. Bounded and optional; dismissed finding concerns schema-invalid events whose failure behavior is documented and accepted.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would auto-approve. Adds optional CLI metadata reporting on stderr after successful generation, with validation and regression coverage.
View guided diff | Turn on auto-fix | Re-trigger cubic
e2e4f17 to
95f5dde
Compare
95f5dde to
ac377a4
Compare
Why
A CLI that projects streamed text discards other event fields, including identifiers needed for a later request. A selected metadata field should remain available without changing the streamed stdout payload.
What changed
Add optional
output.stream.metadata: {select, label}to declared intent and operation commands. Both fields are required nonempty strings; the selector uses existing singular-path and streaming-schema validation. Labels reject nonprintable characters.The shared projector retains the latest nonempty string and reports it once on stderr after clean completion and successful stdout termination. Labels and values are safely escaped. The projector ignores missing or invalid metadata in successfully decoded events; normal typed SDK schema and decoding errors remain unchanged. Explicit rendering choices, raw responses, and machine mode suppress the advisory line; interrupted streams and stdout failures also suppress it.
Add neutral fixtures for single-route and dispatched intents, ordinary and promoted operations, parser diagnostics, runtime retention and failure cases. Keep the new fixtures in CLI-only overlays, with an optional target overlay hook for review generation. Update the CLI documentation, generated review SDK, and changeset.
The shared fixtures caused unrelated SDK golden changes and exposed an existing Python return-annotation mismatch for SSE-only responses. CLI overlays keep this target-specific coverage out of other SDK inputs.
Testing
metadata.go test ./internal/extensions -count=1passed, including metadata validation, open-schema warnings, and escaped-pointer lowering.TARGET=review make test-clipassed after fixture isolation: 609 tests, 2 skipped, plus usage checks.TARGET=primary make test-clipassed: 1,714 tests, zero failures, exit 0. After moving the primary fixture into the CLI overlay, the assembled spec was semantically identical and regenerated jq and metadata tests passed.make lint,make check-template-cli,npm run format, andgo generate ./...passed. Lint used the CI-pinned golangci-lint v2.11.2 built with Go 1.26.8.zSDKs/sdk-cli/.speakeasy/logs/naming.logexcluded. That generated file retains canonical trailing whitespace and remains included in exact regeneration checks.Public-safety check
.claude/skills/public-repo-communication/SKILL.md).git diff --check; the sole exception is canonical trailing whitespace in the generated CLI naming log, described above.