Skip to content

feat(cli): add stack logs - #6593

Merged
jgoux merged 6 commits into
developfrom
feat/stack-logs
Sep 14, 2026
Merged

jgoux merged 6 commits into
developfrom
feat/stack-logs

Conversation

@jgoux

@jgoux jgoux commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Adds supabase stack logs behind the experimental.stack feature flag. Read logs for the current project or select a stack with --stack or --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.

@jgoux
jgoux requested a review from a team as a code owner September 14, 2026 08:22
@jgoux jgoux self-assigned this Sep 14, 2026

@github-actions github-actions Bot 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.

🤖 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.

@jgoux

jgoux commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

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.

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

Should fix before merge

@jgoux
jgoux enabled auto-merge September 14, 2026 11:13
@jgoux
jgoux added this pull request to the merge queue Sep 14, 2026
Merged via the queue into develop with commit f2581b8 Sep 14, 2026
21 checks passed
@jgoux
jgoux deleted the feat/stack-logs branch September 14, 2026 11:23
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