feat(services): export runtime variables from streaming targets - #77
Open
ark-archastro wants to merge 4 commits into
Open
feat(services): export runtime variables from streaming targets#77ark-archastro wants to merge 4 commits into
ark-archastro wants to merge 4 commits into
Conversation
Streaming service targets can set exports_vars to publish JSON snapshots over a private FIFO. Direct dependents consume allowlisted names through inherit_env, and exporter targets are restricted to services up.
- Exporter start failure after ready aborted the supervisor — hold consumers instead, matching process-exit after the first snapshot. - 20s first-snapshot timer included prerequisites and later generations — start the clock when the process is running and abort only before ready. - Colliding export keys unwound the event loop — treat collisions as a hold for the consumer, not a supervisor fatal error. - aster run (and watch/executor spawn) could still execute exporters — reject at the CLI closure and at the spawn seams. - Daemon ready deadline was a single 25s window for serial exporters — refresh it as the supervisor starts each generation. - No tests for the services-up-only gate — added CLI and spawn coverage. Reviewers: grok-native, review-principles
- Ready-deadline refresh used protocol 4 records an old daemon treats as ready — bump to protocol 5 so mixed binaries replace the daemon. - Invalid snapshot reasons forwarded serde text that can include payload values — keep parser errors generic so secrets stay out of logs. - Invalid data after a first snapshot left ready hung with no 20s abort — re-arm the wait and time out on unhealthy, not only missing values. - Daemon deadline was not refreshed while a start generation ran — keep extending it while a start is in flight. - Non-Unix rejected any workspace exporter, not just selected services — gate Unix support on the selected plan. - --no-deps still walked exporter dependencies — skip that closure when the exporter would not run. Reviewers: grok-native, codex-cli, review-principles
- Homogeneous --no-deps still collected same-project exporter deps and failed the run — skip dependency expansion in execute_internal too. - Pre-ready abort still said "initial snapshot" after invalid-after- snapshot — report that the exporter did not become healthy. Reviewers: grok-native, review-principles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Streaming service targets can set
exports_vars = trueand publish JSON snapshots over a private Unix FIFO (ASTER_EXPORT_VAR_PATH). Direct dependents consume allowlisted names throughinherit_env; explicit service env, ports, Aster internals, and leading command assignments stay final. Snapshot changes restart only consumers whose effective environment changed. Invalid or missing snapshots hold those consumers until a healthy one arrives. Exporter targets cannot run outsideaster services up.The daemon protocol is 5 so ready-deadline refresh records are not treated as ready by a v4 daemon.
Verification
cargo fmt --allandcargo clippy --locked --all-targets --all-features -- -D warningscargo test --locked --all-features --lib(unit tests)cargo test --locked --all-features --test dev_services exported_variable(exporter integration and CLI gate)cargo test --locked --all-features --test integration --test watch_tests --test config_bug_bashinherit_envrestarts on an effective change, andaster run/aster watch/aster <target>reject the exporter.Checklist