Commit Graph

10 Commits

Author SHA1 Message Date
can1357 12591dbde3 refactor: restructured streaming output with configurable buffering
- Introduced `StreamWriter` with configurable block and line buffering policies across builtins.
- Updated pipeline stages and compound commands to execute concurrently as tasks.
- Replaced Linux splice and local stream wrapping with generic `Write` streams and explicit flushing.
- Added regression and streaming smoke tests to verify concurrent output and prevent deadlocks.
2026-08-20 03:14:09 +02:00
Samuel Reed 46f31296a1 fix: skip non-UTF-8 host env entries instead of panicking at startup
std::env::vars() panics the moment a host env key or value is not valid
Unicode, before any command can run. A corrupt GHOSTTY_BIN_DIR (bytes 9d d9 50)
staged by cmux/Ghostty tripped both sinks:

- pi-shell's session env copy in create_session_for_run (also merged PATH)
- brush-core's get_host_env_vars, which process builtins (sleep, timeout,
  pgrep, ...) use to inherit the host env into the shells they build

Both now read via std::env::vars_os() and skip entries that cannot be decoded
as Unicode: a corrupt entry carries no usable meaning. PATH merge behavior is
unchanged. Regression tests inject a non-UTF-8 key and value and assert the
shell still starts and PATH survives.

Reported in issue #8925.
2026-08-18 16:18:59 -04:00
can1357 731c051733 feat(pi-shell/minimizer): implemented length threshold and empty preservation
- Add minimum character threshold to bypass minimization for short outputs.
- Add preserve-if-empty configuration and pipeline support for filters.
- Update test fixtures and integration tests to meet length thresholds.
2026-08-08 16:27:03 +02:00
can1357 8facd237d5 feat(build): migrated native pipeline to bazel with remote caching
- Replaced the napi-cli/cargo-zigbuild/cargo-xwin/sccache build path with
  Bazel: rules_rust + crate_universe over Cargo.lock, hermetic zig cc
  toolchains (linux-gnu pinned to glibc 2.17, linux-musl), host Xcode for
  darwin, and a repo-local hermetic clang-cl + llvm-ml + xwin toolchain for
  windows-msvc (bazel/toolchains/msvc).
- All eight shipped addons build as //:natives-<target> via the release
  transition in bazel/defs.bzl (opt, thin LTO, cgu=16, stripped, canonical
  .node naming); scripts/bazel-natives.ts is the single driver for local
  dev and CI.
- Rust validation moved to bazel test + clippy aspects (strict workspace
  policy for opted-in crates, default lints elsewhere, mirroring cargo
  semantics) and the rustfmt aspect; cargo stays as the dev-iteration
  surface, with brush-core/brush-builtins promoted to workspace members
  and excluded from cargo dev tasks to keep their historical scope.
- CI caches through an in-cluster bazel-remote action cache (TLS + basic
  auth, cluster-internal only); GitHub-hosted runners never touch the
  infrastructure and use an actions/cache-backed disk cache instead.
- Deleted the hand-rolled caching machinery: ci-target-cache,
  ci-native-artifact-cache, ci-build-native, native-source-hash,
  find-native-artifacts, restore-linux-native, native-prewarm workflow,
  ensure-* toolchain actions, and all sccache/Swatinem wiring.
- Warm native rebuilds drop from ~20 minutes to seconds; a cold client
  with a warm remote cache rebuilds the linux x64 pair in ~2.5 minutes.
2026-07-27 12:22:19 +02:00
can1357 a8e1f636f6 refactor(minimizer): applied #[must_use] annotations and simplified minimizer parsing internals
- Applied #[must_use] annotations across minimizer and process APIs to flag ignored return values.
- Replaced direct serde_json field reads with typed Value helper calls in several filters.
- Simplified filter parsing with chained if-let guards, rfind checks, and related cleanup.
- Updated minimizer tests and fixtures to build outputs via write! and fmt::Write.
2026-06-12 12:16:18 +02:00
metaphorics 69cc4648dd test(pi-shell): lift max_capture_bytes in the fixtures harness
Prevent oversized fixtures from silently triggering the size passthrough path
and causing a misleading savings-gate failure instead of a real filter failure.

Op: correct
2026-06-12 18:48:56 +09:00
metaphorics 3c53dd9e01 test(pi-shell): add glab fixtures, tighten release view filter
Port rtk glab fixtures (ci-trace, release-list, release-view) to the
minimizer fixture harness with savings gate.

Tighten release-view filter: also strip ASSETS section (no-assets
noise), View-on-GitLab footer link. Update test assertions.

Op: extend
2026-06-12 02:34:04 +09:00
metaphorics 750d85af30 test(pi-shell): add git minimizer fixtures from snip default output
Ports snip's real long-format git status and default git log captures
onto the savings harness (identities scrubbed) to pin the condense_status
and log-entry paths against the 40% gate.

Op: extend
2026-06-12 02:34:04 +09:00
metaphorics 5e63e9d2d4 test(pi-shell): add jvm minimizer fixtures from rtk donors
Ports rtk's Maven and Gradle output fixtures onto the savings harness
(decompressed from .gz where needed; real paths and identities
scrubbed). Exercises the Surefire pass/fail, compile-error, reactor,
and gradle build/test/connected/lint paths against the 40% gate.

Op: extend
2026-06-12 02:34:03 +09:00
metaphorics 7fd70eb7a9 test(pi-shell): add minimizer fixture harness with savings gate
Walks tests/fixtures/minimizer/<family>/<case>.{cmd,raw,exit,min}:
fixtures >=500 bytes must minimize to <=40% of raw size; smaller ones
pin exact snapshots. Seeded with three synthetic fixtures. Donor
parity fixtures from rtk/snip land on this harness in later commits.

Op: extend
2026-06-12 02:34:03 +09:00