Repository navigation
feat(cli): add stack logs - #6593
Conversation
There was a problem hiding this comment.
🤖 AI Review
Both independent reviews completed. After deduplication, 7 findings are confirmed and 2 are refuted. The most serious issue is unsanitized terminal control sequences in text log output; confirmed secondary issues affect interrupt telemetry, documentation, flag telemetry, error guidance, and import hygiene.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🔴 CRITICAL | apps/cli/src/commands/experimental/stack/logs/logs.handler.ts:69 |
security |
codex | Text-mode stack logs render workload-controlled messages without stripping terminal control sequences, allowing forged or manipulated terminal output. |
| 🟡 MINOR | apps/cli/src/commands/experimental/stack/logs/logs.handler.ts:149 |
telemetry |
claude | Ctrl-C interrupts stack log follow mode through the global CLI fiber handler, preventing the command telemetry wrapper from reliably emitting its post-run cli_command_executed event. |
| 🟡 MINOR | apps/cli/src/commands/experimental/stack/logs/SIDE_EFFECTS.md:11 |
documentation |
claude+codex | The side-effect contract omits the telemetry-state write and does not fully specify feature gating or exact text and structured output shapes. |
| 🟡 MINOR | apps/cli/docs/stack-commands.md:12 |
documentation |
claude | The stack command reference omits the newly registered supabase stack logs command. |
| ⚪ NIT | apps/cli/src/commands/experimental/stack/logs/logs.handler.ts:113 |
error-handling |
claude | The missing-named-stack error provides no actionable suggestion despite being classified as a provideFlags error. |
| ⚪ NIT | apps/cli/src/commands/experimental/stack/logs/logs.command.ts:36 |
telemetry |
claude | The boolean -f alias collides with the global value-consuming short-flag registry, causing the telemetry scanner to skip the following flag token. |
| ⚪ NIT | apps/cli/src/commands/experimental/stack/logs/logs.integration.test.ts:35 |
style |
claude | The integration test imports the same command-mocks module twice. |
Findings outside the diff
- 🟡 MINOR
apps/cli/docs/stack-commands.md:12— The stack command reference omits the newly registered supabase stack logs command.
Refuted findings (kept for transparency, not posted as review comments)
apps/cli/src/commands/experimental/stack/logs/logs.handler.ts:135(output-contract): A bounded stream-json read emits log-entry events without a terminal result event, allegedly violating the repository's streaming-output contract.
Refuted: The behavior is real, but no trusted convention requires every stream-json operation to emit a result event. The trusted SIDE_EFFECTS template says such a terminator is only typical, and Output.event is structured machine output; bounded completion is also observable through EOF and process status. The differing compute-logs design does not establish a mandatory repository contract.apps/cli/src/commands/experimental/stack/logs/logs.command.ts:21(usability): The --service choices allegedly should include the supervisor and gateway internal log sources.
Refuted: The public LogQuerySchema defines the filter specifically as capabilities: CapabilityName[], and LogStore.selectLogBatch deliberately excludes supervisor and gateway when that capability filter is present. The CLI's description says it limits logs to a stack service; internal sources remain available when no service filter is supplied.
Stats
Claude findings: 8 · Codex findings: 2 · Confirmed: 7 · Refuted: 2 · Uncertain: 0
Models: claude-opus-5 + gpt-5.6-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
|
The additional documentation finding in the review summary is also addressed in becc487: the maintained stack command reference now includes stack logs, target selection, history/follow behavior, and structured output examples. All inline findings have been handled; the pre-existing shared interruption telemetry limitation is deferred as explained in its thread. |
Adds
supabase stack logsbehind theexperimental.stackfeature flag. Read logs for the current project or select a stack with--stackor--stack-id, filter by--service, limit retained history with--tail, and follow new entries with--follow/-f.Supports text, bounded JSON, and streaming JSON output. Interrupting a log follower leaves the stack running, and retained logs remain readable after the stack stops.
Supersedes #6510.