Skip to content

ci: stream routed command output while retaining exact evidence bytes #1658

Description

@EffortlessSteven

Problem

ci-record-command retains exact stdout/stderr bytes for routed-Rust evidence, but it buffers child output until the command exits. Long Cargo commands therefore provide no live progress and can consume unnecessary memory even though the retained log bytes are correct.

Target seam

  • xtask/src/main.rs: ci-record-command command execution and receipt finalization
  • xtask/src/run.rs: child process IO adapter
  • xtask/src/tests.rs: byte/order/exit-state controls
  • .github/workflows/routed-rust.yml: consumer only if the command interface changes

Acceptance criteria

  • Stream child stdout and stderr to the job log while the child is running.
  • Retain deterministic evidence bytes for the exact command and preserve the digest contract consumed by ci-child-receipt and ci-routed-rust-result.
  • Preserve child exit code, passed/failed/not_run ordering, cancellation behavior, and failure-class semantics.
  • Add a discriminator that would fail if output were buffered until process exit.
  • Add byte-level controls for interleaved stdout/stderr, non-UTF-8 bytes, partial writes, and a failing child.
  • Keep the resulting PR review-forward and independent of routing, cache, runner, or protected-authority changes.

Proof commands

cargo test -p xtask --locked ci_record_command -- --test-threads=1
cargo test -p xtask --locked routed_rust -- --test-threads=1
cargo clippy -p xtask --all-targets --locked -- -D warnings
cargo fmt --all -- --check

Non-goals

  • Changing the routed proposition table or required checks.
  • Changing cache ownership or branch protection.
  • Treating terminal output timing as correctness evidence.

Source truth

Risk / rollback

The main risk is reordering or losing bytes while teeing two streams. Keep the existing buffered adapter available until the new byte/order controls pass. Rollback is a revert to buffered capture; that restores current observability without weakening receipt correctness.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions