Skip to content

feat(embed): report lifecycle script output - #1284

Merged
jdx merged 2 commits into
mainfrom
codex/stream-embedded-lifecycle-output
Aug 12, 2026
Merged

jdx merged 2 commits into
mainfrom
codex/stream-embedded-lifecycle-output

Conversation

@jdx

@jdx jdx commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • capture lifecycle script stdout and stderr when installs use event output mode
  • emit each lifecycle line as a tagged InstallEvent::Output for embedding hosts
  • preserve inherited stdio for standalone and non-event installs
  • cover stdout and stderr routing through the public embed API

Motivation

Embedding hosts such as mise render their own progress UI. Lifecycle scripts currently bypass aube’s event reporter and write directly to the shared terminal, which corrupts those progress displays. Tagged output events let the host print lifecycle logs through its progress renderer without pausing all progress.

Tests

  • cargo test
  • cargo clippy --all-targets -- -D warnings
  • cargo fmt --all -- --check

AI-assisted — Tool: Codex; model: unavailable/unavailable; version: unavailable.


Note

Medium Risk
Changes lifecycle script I/O for event-mode installs (piping and async forwarding) while preserving inherited stdio elsewhere; incorrect piping or backpressure could affect long-running or verbose scripts.

Overview
Embedding hosts that use event output mode can now receive lifecycle script stdout/stderr instead of those scripts writing directly to the shared terminal.

aube-scripts adds an optional ScriptOutputReporter: when set, lifecycle children are spawned with piped stdio, output is read line-by-line (with 64 KiB chunks for long lines without newlines), and each chunk is forwarded to the reporter. With no reporter, behavior stays inherited stdio. set_script_settings_with_path_order now updates settings fields in place so it does not clear an installed reporter.

Install / embed: at install start, set_output_reporter is wired from InstallControl when output mode is Events. Lines become InstallEvent::Output at info level with code AUBE_LIFECYCLE_SCRIPT_OUTPUT. The constant is re-exported on the public embed API. An embed integration test asserts both stdout and stderr from a root dev-preinstall hook show up as tagged events.

Reviewed by Cursor Bugbot for commit 240b758. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • Lifecycle script output can now be captured and reported as install events.
    • Standard output and error output are identified separately and forwarded line by line.
    • Install integrations can subscribe to lifecycle-script output through the embedding API.
  • Bug Fixes

    • Preserved the default behavior of inheriting script output when no reporter is configured.
  • Tests

    • Added coverage verifying that lifecycle script output is emitted through install event reporting.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: c79459f0-644c-45b5-9cde-cc372d93f560

📥 Commits

Reviewing files that changed from the base of the PR and between f951647 and 240b758.

📒 Files selected for processing (2)
  • crates/aube-scripts/src/lib.rs
  • crates/aube/tests/embed.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/aube/tests/embed.rs
  • crates/aube-scripts/src/lib.rs

📝 Walkthrough

Walkthrough

Changes

Lifecycle script output

Layer / File(s) Summary
Reporter API and settings
crates/aube-scripts/src/lib.rs
Adds ScriptOutputStream, ScriptOutputReporter, and scoped or process-wide reporter settings.
Script output capture
crates/aube-scripts/src/lib.rs
Pipes configured script output, reads both streams concurrently, normalizes line endings, and forwards bounded records.
Install event integration
crates/aube/src/commands/install/..., crates/aube/src/embed.rs, crates/aube/tests/embed.rs
Registers an events-mode reporter, emits informational lifecycle-script events, re-exports the event code, and tests stdout and stderr.

Estimated code review effort: 4 (Complex) | ~45 minutes

Mergeability Score: ⚪ Minimal · up to 240b7

Lifecycle output is routed through tagged events only for event-mode installs, while standalone and non-event installs retain inherited stdio; no actionable merge-blocking risk remains beyond normal checks and review.

Possibly related PRs

  • jdx/aube#1086: Both changes modify install-time lifecycle-script integration in install::run_inner.

Poem

I’m a rabbit with logs in my burrow tonight,
Stdout hops left and stderr hops right.
Each line gets a tag, neat and bright,
Install events carry the signal just right.
Squeak—both streams now stay in sight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: reporting lifecycle script output for embedded installs.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR routes lifecycle-script stdout and stderr through structured install output events for embedding hosts while retaining inherited stdio outside event mode.

  • Adds a scoped lifecycle-output reporter and bounded asynchronous pipe draining.
  • Exposes lifecycle output through the public embed API under a dedicated event code.
  • Adds integration coverage for stdout and stderr event delivery.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/aube-scripts/src/lib.rs Adds scoped output reporters, pipes lifecycle child streams in event mode, and forwards bounded output records while preserving inherited stdio otherwise.
crates/aube/src/commands/install/control.rs Adapts lifecycle output into structured informational install events with a dedicated public code.
crates/aube/src/commands/install/mod.rs Installs the event-mode script reporter within each install’s isolated script-settings scope.
crates/aube/src/embed.rs Re-exports the lifecycle-script output event code through the stable embedding API.
crates/aube/tests/embed.rs Verifies that lifecycle stdout and stderr are delivered through the public event reporter.

Reviews (2): Last reviewed commit: "fix(embed): bound lifecycle output recor..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/aube-scripts/src/lib.rs`:
- Around line 1195-1208: Update the lifecycle output-reading loop around
BufReader::read_until so each record has a bounded maximum size before being
appended to buffer. When the limit is exceeded, either return a controlled error
or report the data as bounded chunks, while preserving normal newline trimming
and reporter.report behavior for records within the limit.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: e85005be-7216-4ba9-aa3b-a3b08d68156a

📥 Commits

Reviewing files that changed from the base of the PR and between 7237e12 and f951647.

📒 Files selected for processing (5)
  • crates/aube-scripts/src/lib.rs
  • crates/aube/src/commands/install/control.rs
  • crates/aube/src/commands/install/mod.rs
  • crates/aube/src/embed.rs
  • crates/aube/tests/embed.rs

Comment thread crates/aube-scripts/src/lib.rs Outdated
@github-actions

github-actions Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Instruction counts

benchmark trend instructions Δ wall (min) Δ
graph ▂▂█▂▁▁▁▂██▁▇▁▂▂█▃▁▂▁ 17,572,451 → 17,562,581 -0.06% 4.38 → 4.42ms +0.88%
install ▁▁▃▃▃▄▃▄▃▃▃▃▃▇▇▇▇▇██ 108,632,224 → 108,640,543 +0.01% 24.76 → 25.01ms +1.00%
startup ▁▂▃▄▃▃▃▃▄▄▄▃▃▅▅▆▄▄▆█ 7,482,177 → 7,484,024 +0.02% 3.28 → 3.37ms +2.85%
tree ▅▅▃▂▃▂▂▂▄▂▄▃▃▂▄▂▃▁▄█ 17,750,784 → 17,760,522 +0.05% 4.54 → 4.96ms +9.30%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

240b75817b23 vs 7237e127cb87 · measured on this runner, not pushed to the history.

@jdx
jdx merged commit 7ccf93a into main Aug 12, 2026
66 of 70 checks passed
@jdx
jdx deleted the codex/stream-embedded-lifecycle-output branch August 12, 2026 22:54
@cursor cursor Bot mentioned this pull request Aug 12, 2026
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.

1 participant