chore(stella-media): fix the live-smoke gate, preview labels, branding#591
Merged
Conversation
A stray double blank line in accounted_call.rs after the use block was tripping `cargo fmt --check`, turning the CI gate red on main and on every branch cut from it. Reformat so downstream PRs inherit a green baseline.
Three of the ten items in the area:media audit batch (#565). The other seven are deferred: each one's own Fix text disclaims it as owner judgment or as a behavior change on a path other crates drive. Item 1 — the live-smoke opt-in. All three gates read `std::env::var("OXAGEN_MEDIA_LIVE").is_err()`, so ANY value armed the paid tests, including `0`, `false` and the empty string, while the module doc at adapters/mod.rs:14 and the comments in zai_image.rs / zai_video.rs all promised `=1`. `OXAGEN_MEDIA_LIVE=0 cargo test -p stella-media` submitted a real, billable CogVideoX job. The three sites now share one `live_smoke_enabled()` helper in `adapters` that requires the literal `1`, matching `live_smoke_enabled` in stella-model/tests/live_smoke.rs. The comments are unchanged — the code was the thing that was wrong. Witness: `adapters::tests::only_the_literal_one_arms_the_paid_live_smokes`. It asserts over `live_smoke_armed_by`, the pure half of the gate, rather than mutating the process environment: `set_var` on `OXAGEN_MEDIA_LIVE` would race every live-smoke test thread reading it, which is exactly the variable that decides whether we spend money. Item 9 — `plain_line` hard-coded the `[image]` prefix, so the fallback rung announced a generated video as `[image] saved to .../med_x.mp4`. That rung is what every non-kitty, non-iTerm2 terminal and every CI run gets. `plain_line` and `render` now take a `MediaKind` and render `[image]` / `[svg]` / `[video]`. `render` is re-exported as `stella_media::render_preview`; there are no other in-repo callers, and `cargo check --workspace --all-targets` is clean. Witness: `preview::tests::plain_line_labels_the_kind_it_was_given`. Item 7 — branding. stella-media's crate docs said generation is "for the Oxagen CLI"; the binary is `stella` and the other fifteen crate docs say Stella. stella-context was the only crate description written in shouting caps. Both fields surface in `cargo metadata`. The SPDX copyright header and the legitimate `Oxagen` uses in stella-serve and stella-tui's theme are untouched. Closes #565 Signed-off-by: macanderson <mac@oxagen.sh>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Sorry @macanderson, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
macanderson
marked this pull request as ready for review
July 25, 2026 19:48
There was a problem hiding this comment.
Sorry @macanderson, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
macanderson
enabled auto-merge (squash)
July 25, 2026 19:48
macanderson
disabled auto-merge
July 25, 2026 19:54
macanderson
added a commit
that referenced
this pull request
Jul 25, 2026
The area:media batch (#591) landed the same live-smoke gate fix this branch carried, under a different name, so the two collided three ways in the adapters plus a silent duplicate definition that auto-merge left in mod.rs. Resolved onto main's shape: live_smoke_enabled + the pure, witnessed live_smoke_armed_by half, which requires the literal "1" because these tests submit billable provider jobs. Kept this branch's contribution by having the env read prefer STELLA_MEDIA_LIVE -- the spelling the module docs already advertise and every other STELLA_* toggle uses -- with OXAGEN_MEDIA_LIVE still honoured as the deprecated alias. Dropped the duplicate live_smokes_armed definition.
This was referenced Jul 25, 2026
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.
Closes #565
Three of the ten
area:mediaaudit items. The other seven are deferred with a reason each — see below. Partial batches are explicitly allowed by the issue.What changed
Item 1 — the live-smoke opt-in only arms on the literal
1All three live smokes gated on
std::env::var("OXAGEN_MEDIA_LIVE").is_err(), so any value armed them —0,false,true, the empty string.OXAGEN_MEDIA_LIVE=0 cargo test -p stella-mediasubmitted a real, billable CogVideoX job, while the module doc (adapters/mod.rs:14) and the two adapter comments all promised=1.The three sites now share one gate in
stella-media/src/adapters/mod.rs:matching
live_smoke_enabledinstella-model/tests/live_smoke.rs:67-69. The comments are unchanged, per the issue's Fix text — the code was the thing that lied.A named helper (rather than three inline
is_ok_ands) is a hair beyond the literal Fix text, and it is deliberate: it is what makes the gate witnessable and stops the three families drifting apart again.Witness:
adapters::tests::only_the_literal_one_arms_the_paid_live_smokes— asserts"1"arms and"0" / "false" / "true" / "yes" / "" / " 1" / "1 " / "01" / unsetdo not. It asserts overlive_smoke_armed_by, the pure half of the gate, instead of mutating the process env:set_var("OXAGEN_MEDIA_LIVE", …)would race the very test threads reading that variable to decide whether to spend money. The test fails to compile onmain(the helper does not exist) and passes here.Item 9 — the plain preview rung labels the kind it was given
plain_linehard-coded[image], so the fallback rung announced a generated video as[image] saved to …/med_x.mp4. That rung is what every non-kitty, non-iTerm2 terminal and every CI run sees.plain_lineandrendernow take aMediaKindand render[image]/[svg]/[video].API note: this changes an exported signature —
renderis re-exported asstella_media::render_preview. There are zero other in-repo callers (stella-tui'srender_previewis an unrelated local fn), andcargo check --workspace --all-targetsis clean.Witness:
preview::tests::plain_line_labels_the_kind_it_was_given;plain_line_cites_the_pathandrender_dispatches_by_rungare updated as the issue asks.Item 7 — branding / description cleanup
stella-media/src/lib.rs— "for the Oxagen CLI" → "for the Stella CLI" (the binary isstella; it was the onlyOxagen CLIhit in the tree).stella-context/Cargo.toml— "THE CONTEXT PLANE: …" → "The context plane: …", the only crate description in shouting caps.Untouched on purpose: the SPDX
Copyright (c) 2026 Oxagen, Inc.headers,stella-serve/src/{lib,frame,remote}.rs(a genuine external host), andstella-tui/src/theme.rs:12(a brand-asset name) — all called out as correct by the issue itself.No witness (docs/metadata only); verified via
cargo metadata.Checklist from the issue
adapters/mod.rs:14— live-smoke gate accepts any value (item 1)zai_video.rs:244— unknowntask_statusmaps to Running forever (item 2)artifact.rs:118—save_with_idsilently overwrites + duplicates a manifest row (item 3)artifact.rs:200—append_manifesthas no cross-writer lock, fixed temp name (item 4)error.rs:65—MediaError::Cancelledis never constructed (item 5)http.rs:98—download_byteshas no size cap (item 6)lib.rs:3— branding leakage into crate docs and descriptions (item 7)operation_journal.rs:517—journal_errorfunnels intoMediaError::Artifact(item 8)preview.rs:106—plain_linehard-codes[image](item 9)svg.rs:337—references_externalscheme test +styleattribute (item 10)Deferred
Every deferred item is one the issue's own Fix text declines, and each needs a decision this PR is not entitled to make.
poll_videounknowntask_status_ =>arm. The remediation offers two different designs (age-aware terminal check onMediaJobStatusvs. a caller-side deadline) and an unspecified "N minutes". Picking the layer and the timeout is owner judgment, and the failure mode — a provider inventing a new terminal status — is not reproducible locally.save_with_idoverwriteMediaError::Artifact), andstella-tools/stella-clidrive this path.append_manifestlockingJobStore::mutation_lockinto a shared helper — a cross-module refactor whose contended behavior I cannot verify with a local run.MediaError::CancelledMediaProvidertrait (hard rule 3)", then offers the opposite option (delete the variant). Pure owner judgment on whether cancellation is in scope.download_bytessize capjournal_error→MediaError::ArtifactMediaError::Journal(String)variant is a public-enum change that other crates match on." (For the record: the cross-crate uses instella-tools/stella-cliare variant constructions, not exhaustive matches, so it would likely still compile — but the enum is public API, the issue disclaims it, and "update theSidecarRaceneighbours' docs" is unbounded.)stella-tools' media tests exercise this path (hard rule 4)" — the issue invokes a hard rule on itself. The prescribed scheme test (<ascii-alpha>[a-z0-9+.-]*:) over all attribute values has real false-positive risk on legitimate SVG (any value containingword:), which would silently strip valid attributes; the existing hostile corpus only tests the attack side, so a green local run would not catch the over-blocking.svg.rs:51-58already records this under "Known limits". Security-sensitive — half-doing it is worse than not doing it.Verification
Run from the worktree:
stella-contextis clippy'd and tested too because this PR touches itsCargo.toml. No pre-existing failures were encountered.Merge-order note
adapters/{mod,openai_image,zai_image,zai_video}.rsandstella-context/Cargo.tomlare also being touched by the PRs for #557 and #560. The edits here are deliberately kept to one added block plus three one-line call-site swaps, and a single description line, so the PRs should merge in any order.