Commit Graph

220 Commits

Author SHA1 Message Date
metaphorics 3bf68d8a12 feat(pi-shell): group clippy lints enabled via -W/-D command-line notes
extract_lint_rule now recognizes the '-W <rule>' / '-D <rule>' note
forms so CLI-enabled lints group with their rule instead of scattering
into the ungrouped bucket.

Op: extend
2026-06-12 02:34:04 +09:00
metaphorics dc701a76ee perf(pi-shell): strip cargo lock-wait and warning-rollup noise
is_compiling_noise now drops 'Blocking waiting for file lock' and the
'generated N warnings' rollup line while keeping the individual
diagnostic blocks and the failing-crate build trailers.

Op: compress
2026-06-12 02:34:04 +09:00
metaphorics 1b44c904d6 fix(pi-shell): keep cargo test passing lines out after a failure latches
failures_only no longer leaks a later suite's passing 'test ... ok'
lines once an earlier failure latched the keep flag, matching the
single-purpose failures-only contract.

Op: correct
Restores: spec:rtk/src/cmds/rust/cargo_cmd.rs
2026-06-12 02:34:04 +09:00
metaphorics f15333c472 feat(pi-shell): add npx unknown-tool fallback def
defs/npx.toml strips the first-run install prompt, npm warn/notice
lines, and blanks for 'npx <tool>' invocations of tools without a
dedicated Rust filter, capping output. Routed tools are claimed first
by dispatch, so the def only fires for unknown tools.

Op: extend
2026-06-12 02:34:04 +09:00
metaphorics ef850baa6a feat(pi-shell): align biome and oxlint output through lint.rs
With the widened claim, biome/oxlint path-arg invocations now share the
Rust lint shape instead of splitting between Rust and their defs: code
frames and box-drawing rows are stripped while '× rule: message' and
'╭─[file]' locations are kept. The defs remain as residual fallback for
unclaimed subcommands.

Op: compress
2026-06-12 02:34:04 +09:00
metaphorics 8c4d66d893 feat(pi-shell): parse eslint stylish output into grouped diagnostics
lint.rs attributes indented L:C rows to their file header and renders
the shared grouped 'N diagnostics in M files' summary with top rule-ids,
dropping the 'potentially fixable' hint while keeping the problem
count. Re-derived from default stylish output, no JSON injection.

Op: extend
2026-06-12 02:34:04 +09:00
metaphorics a327ffcea1 feat(pi-shell): claim tsc/eslint/biome/oxlint and strip tsc code frames
Widens lint.rs program claim so path/flag-arg invocations like
'tsc --project x' and 'eslint src/' are filtered instead of passing
through raw, and strips tsc code-frame and underline rows. The grouped
per-file diagnostic output is kept over flat line-matching.

Op: extend
2026-06-12 02:34:04 +09:00
metaphorics ac611042e5 fix(pi-shell): keep one install summary, strip funding nags in pkg
npm/pnpm/yarn/bun success output now keeps a single 'added N packages'
/ 'up to date' summary (the count confirms install state) while the
funding solicitation lines — which also defeated the head/tail cap —
are stripped. Real audit findings stay visible; pnpm progress bars and
yarn step/YN0000 box lines are dropped.
2026-06-12 02:34:04 +09:00
metaphorics 95e3e9b11e perf(pi-shell): drop jest console noise and redundant suite summary
node_tests.rs now strips jest 'console.' log lines and the
zero-information 'Ran all test suites' summary while keeping the
pass-run collapse and failure context. Adds ported snip jest tests and
a vitest AssertionError regression pin.

Op: compress
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 0c799f6637 perf(pi-shell): dense ok-summaries for gt sync and restack
gt sync/restack success output collapses to a one-line count summary
('ok sync: N synced, M deleted', 'ok restacked N branches') parsed
from default output, falling back to the existing line-keeping filter
when the parse finds nothing or the run failed.

Op: compress
2026-06-12 02:34:04 +09:00
metaphorics 20fe2842ea feat(pi-shell): summarize gh pr checks output
A dedicated 'pr checks' arm parses gh's default status table into a
passed/failed/pending summary, keeping failed rows (and their URLs)
visible while collapsing passing checks to a count. Raw modes
(--json/-w) still pass through.

Op: extend
2026-06-12 02:34:04 +09:00
metaphorics 9d8d6499c7 feat(pi-shell): condense git worktree list output
A new condense_worktree abbreviates the home directory to '~' and caps
long 'git worktree list' output with an omitted-count marker, detecting
the listing shape from the output itself. Non-listing worktree output
(add confirmations, errors) is left untouched.
2026-06-12 02:34:03 +09:00
metaphorics b75ba9be2a feat(pi-shell): append change summary to git commit ok line
The commit success line now carries the stat summary parsed from
default output — 'ok 1a2b3c4 (3 files +10 -2)' — restoring the
files/insertions/deletions signal at a cost of a few tokens. Bare
'ok <hash>' is kept when no stat line is present.
2026-06-12 02:34:03 +09:00
metaphorics d61cfe92f1 perf(pi-shell): bound git log entry lines and mark omitted body lines
push_log_entry truncates over-long subject/body lines via
primitives::truncate_line, and bodies past the 3-line cap now end with
an explicit '[+N lines omitted]' marker instead of silently dropping
the remainder.
2026-06-12 02:34:03 +09:00
metaphorics d0976ad7b0 feat(pi-shell): surface rebase and merge-ready sub-states in git status
detect_status_state now distinguishes 'merge (ready to commit)' from an
unresolved merge conflict and recognizes interactive-rebase sub-states
(editing/splitting a commit, command progress) as rebasing. These
headers appear in git's default long-format status, so no flag
injection is needed.
2026-06-12 02:34:03 +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 d63bacf93b feat(pi-shell): route mvn/gradle output through jvm filter module
Adds filters/jvm.rs porting rtk's Maven (Surefire/Failsafe state
machine, compile warning-dedup with continuation tracking, package
reactor-summary keeper, quiet mode) and Gradle (build/test/connected/
lint/dependencies, Spring Boot run) filters — cross-line state the TOML
DSL cannot express. Phase and task are decided by re-tokenizing the
command (last goal / last non-clean task), not the first-arg subcommand.

Deletes defs/maven.toml, defs/gradle.toml, defs/mvn-build.toml in the
same change: the engine re-applies builtin pipelines as overlays on
Rust output, so leaving them would strip the module banners and reactor
summaries jvm.rs preserves. mvn-build.toml was already dead config —
maven.toml sorts ahead of it and claimed every mvn invocation first.

The ported rtk Surefire/compile/reactor unit tests load their input via
include_str! from filters/fixtures/jvm/ (real paths scrubbed); those
fixtures ship with the module since they are compile-time inputs.

Op: compress
2026-06-12 02:34:03 +09:00
metaphorics 9aa3bfd502 test(pi-shell): pin skopeo inspect passthrough and empty sentinel
Ports rtk's inspect JSON passthrough test — guarding the def's
primary purpose against strip-pattern overreach — and the empty-input
sentinel test.

Op: correct
Restores: test:rtk skopeo "inspect keeps output"
2026-06-12 02:34:03 +09:00
metaphorics 24d81db246 fix(pi-shell): align liquibase banner and version handling with rtk
Two-hash ASCII-art body rows, bracket-INFO hash borders, the Open
Source edition banner, and the Java Home/Libraries/jar-list env dump
all survived the def, while the one meaningful line of --version
output — the version itself — was stripped. rtk keeps the version and
strips the rest; the def now matches.

Op: correct
Restores: spec:rtk/src/filters/liquibase.toml
2026-06-12 02:34:03 +09:00
metaphorics accdaa9c87 fix(pi-shell): stop ping overlay masking failures and Windows stats
Error terminations with no stats block collapsed to empty and the
ungated on_empty reported 'ping: ok' on nonzero exits. The overlay now
runs only on exit 0, keeps timeout/unreachable/error lines and the
Windows statistics block, and bounds lossy runs with a tail cap.

Op: correct
Restores: spec:rtk/src/filters/ping.toml
2026-06-12 02:34:03 +09:00
metaphorics 32889ecb19 fix(pi-shell): exempt ollama run responses from output caps
The capped def claimed every subcommand including run, where the
model response is the payload rtk deliberately left uncapped. The
general entry now gates to management subcommands; a separate run
entry strips braille spinner residue and applies no caps.

Op: correct
Restores: spec:rtk/src/filters/ollama.toml
2026-06-12 02:34:03 +09:00
metaphorics 19287f05f7 fix(pi-shell): short-circuit clean swift builds with widened guard
Clean swift build output collapses to 'ok (build complete)'. The
unless guard adds Test Suite/failed beyond rtk's warning/error terms
because this def also matches swift test, which prints Build complete!
before test results. Linking phase lines are stripped in both plain
and bracketed progress forms.

Op: correct
Restores: spec:rtk/src/filters/swift-build.toml
2026-06-12 02:34:03 +09:00
metaphorics 0d0fd51b4d fix(pi-shell): short-circuit clean rsync runs
A clean sync collapses to 'ok (synced)' via a guarded match_output on
'total size is'; the unless guard keeps error runs intact, where the
sent/received stats remain diagnostic. Blank separator lines are
stripped on the non-clean path.

Op: correct
Restores: spec:rtk/src/filters/rsync.toml
2026-06-12 02:34:03 +09:00
metaphorics 74ec47a35e fix(pi-shell): strip xcodebuild signing and packaging phase noise
CodeSign/Validate/ProcessProductPackaging/GenerateDSYMFile and the
other archive-build phase banners plus indented absolute-path tool
invocation lines appear in every device build and leaked through;
rtk strips all of them. Test runner output and diagnostics survive.

Op: correct
Restores: spec:rtk/src/filters/xcodebuild.toml
2026-06-12 02:34:03 +09:00
metaphorics dd19333d64 fix(pi-shell): strip ssh client-side connection noise
Permanently-added warnings, connection-closed notices, Authenticated
to, debug1:, OpenSSH_ version banners, and pseudo-terminal warnings
are client chatter, not remote payload; rtk strips all six. Remote
output stays untouched per the def's passthrough stance.

Op: correct
Restores: spec:rtk/src/filters/ssh.toml
2026-06-12 02:34:03 +09:00
metaphorics e22452a80a fix(pi-shell): strip nx separators and chrome, cover wrapped nx runs
Em-dash separator rows, the cache-replay notice, and the 'Nx (powered
by Nx Cloud)' footer survived the def. rtk also matched pnpm-wrapped
invocations; a companion entry on (pnpm|npx|yarn) + subcommand nx now
covers them — pkg's whitelist does not claim nx, so dispatch falls
through to the def.

Op: correct
Restores: spec:rtk/src/filters/nx.toml
2026-06-12 02:34:03 +09:00
metaphorics cc9b7e779c fix(pi-shell): strip mise download and checkmark progress
Download/extract progress and trust/install checkmark echo lines are
pure chrome; rtk strips all three. Install-result lines stay — the
'X installed' line is the meaningful summary of what changed.

Op: correct
Restores: spec:rtk/src/filters/mise.toml
2026-06-12 02:34:03 +09:00
metaphorics 84074a1fc3 fix(pi-shell): strip glog warnings and blanks in helm def
client-go emits W-prefixed glog warnings during repo/list operations
and helm separates sections with blank lines; rtk strips both.

Op: correct
Restores: spec:rtk/src/filters/helm.toml
2026-06-12 02:34:03 +09:00
metaphorics 6e411e3550 fix(pi-shell): strip in-flight shopify theme download progress
The def stripped past-tense Downloaded/Uploaded lines but not the
in-flight 'Downloading ...' progress printed during theme pull, and
Shopify CLI indents progress under spinners so the Uploading anchor
needed loosening.

Op: correct
Restores: spec:rtk/src/filters/shopify-theme.toml
2026-06-12 02:34:03 +09:00
metaphorics b569a02712 fix(pi-shell): strip turbo cache miss/bypass and bare scope lines
The def stripped only 'cache hit, replaying logs'; miss/bypass status
lines and the bullet-less 'N packages in scope' variant survived. The
Tasks:/Duration: summary stays — one line of high-signal counts.

Op: correct
Restores: spec:rtk/src/filters/turbo.toml
2026-06-12 02:34:03 +09:00
metaphorics e25d5d27c7 fix(pi-shell): strip ty version banner and progress lines
When diagnostics exist the clean-run short-circuit does not fire and
the 'ty 0.x.y' banner plus 'Checking N files' progress line leaked
through; rtk strips both.

Op: correct
Restores: spec:rtk/src/filters/ty.toml
2026-06-12 02:34:03 +09:00
metaphorics 76ea65f78d fix(pi-shell): strip jj hint lines
jj prints advice lines such as 'Hint: use jj log ...' after most
commands; rtk strips them. Working-copy summary lines stay — they
carry the operative change-id.

Op: correct
Restores: spec:rtk/src/filters/jj.toml
2026-06-12 02:34:03 +09:00
metaphorics 8fec8e121e fix(pi-shell): strip Docker chain headers and blanks in iptables def
On Docker hosts iptables -L is dominated by DOCKER/DOCKER-USER/BR-*
chain headers and blank chain separators; rtk strips both. Header-line
removal only — rule lines under those chains still pass through.

Op: correct
Restores: spec:rtk/src/filters/iptables.toml
2026-06-12 02:34:03 +09:00
metaphorics 0a255df9d8 fix(pi-shell): strip blank separator lines in gcloud def
rtk strips blank lines and gcloud routinely emits them between status
lines and tables; removing them composes with the on_empty sentinel.

Op: correct
Restores: spec:rtk/src/filters/gcloud.toml
2026-06-12 02:34:03 +09:00
metaphorics 0fb4b28d37 feat(pi-shell): detect gradlew/mvnw wrappers and glab subcommands
Exact-allowlist normalization maps gradlew.bat -> gradlew and
mvnw.cmd -> mvnw so wrapper invocations dispatch to the same filters;
generic extension stripping would over-match unrelated scripts. glab
gains gh-style global-flag skipping for subcommand detection.

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
metaphorics 3288d56ea6 feat(pi-shell): add replace_after post-filter substitution stage
Ordered regex substitutions applied after strip/keep line filtering and
before per-line truncation. snip donors apply path compaction and
similar rewrites post-filter (~31 placements); the pre-filter replace
list cannot express that without re-matching stripped lines.

Op: extend
2026-06-12 02:34:03 +09:00
metaphorics f58d6fabcb feat(pi-shell): allow strip and keep line filters to coexist
55 of 131 snip donor filters use remove_lines and keep_lines together;
the TOML DSL now applies both: a line survives iff it matches the keep
set (when present) and does not match the strip set (when present).
The CompiledLineFilter special-casing is gone — one general code path.

Op: extend
2026-06-12 02:34:03 +09:00
can1357 0d4fedeeb5 fix(natives): pass pyright --outputjson output through the lint minimizer untouched 2026-06-10 09:51:44 +02:00
can1357 96e66923ce fix(minimizer): treat any bare '-' token as aws stdin/stdout streaming
is_aws_stdout_pipe() used rfind over whitespace tokens, so a value-taking
option after the '-' destination (e.g. 'aws s3 cp s3://b/k - --request-payer
requester') made the check miss and the streamed object body was rewritten
by strip_transfer_progress/JSON compaction. Any bare '-' token now forces
passthrough; a false positive only skips minimization. Also moved the
changelog entries back under '## [Unreleased]' after they slid beneath
released headings during the rebase onto main.

Addresses review feedback on #2176.
2026-06-10 08:31:30 +02:00
David Andrews (LexGenius.ai) 3a73107cce fix(minimizer): address PR 2176 review feedback 2026-06-10 08:31:30 +02:00
David Andrews (LexGenius.ai) ce7ec45d42 feat(minimizer): deterministic shell-output minimizer on 15.10.8 2026-06-10 08:31:30 +02:00
can1357 9d457f73d9 test: migrated test imports to package subpath exports
- Replaced relative `../src` imports with `@oh-my-pi/pi-ai` and `@oh-my-pi/pi-agent-core` subpaths.
2026-06-08 19:03:55 +02:00
can1357 5ba7180d48 feat(pi-shell): added nohup builtin that doesn't mask SIGHUP
- Ran the operand as an ordinary descendant so it is reaped with the host instead of leaking as an orphan.
- Propagated the command's exit status; reported missing operand and exit 125 with no operand.
- Updated the bash tool prompt's daemon guidance away from nohup/setsid/disown detachment.
- Switched shell renderer success icon/state to "done".
2026-06-08 18:28:08 +02:00
can1357 b5582278a0 feat(builtins): implemented wait for pids, -f, -n, and -p flags
- Added process ID resolution and selectors for waited jobs.
- Implemented terminate-only waits and next-job polling.
- Recorded completed job IDs into the variable named by -p.
- Added shell integration tests covering the new wait paths.
2026-06-08 18:28:07 +02:00
can1357 003f89b7c4 fix: fixed UTF-8 command slicing in shell fixups
- Converted brush-parser source positions to byte offsets before slicing commands in `try_strip_head_tail` and `try_strip_2to1`, preventing multibyte UTF-8 from misplacing fixup deletions.
- Added regression tests covering trailing `head`/`tail` and `2>&1` strips with Unicode content, and verified rewritten commands re-parse successfully.
2026-06-07 03:49:15 +02:00
can1357 cd9fc55572 fix: aborted internal background jobs during shell cancellation
- Added Job::abort_internal_tasks to abort internal async tasks and drop their join handles.
- Updated shell cancellation paths to call this abort logic and handle mutable shell job lists before signaling remaining process groups.
- Added Rust and TypeScript tests that verify cancellation prevents background shell jobs from completing after abort.
2026-06-02 19:30:40 +02:00
can1357 4ee35bec7a fix: corrected child-session behavior to DetachSession for non-term stdin
- Renamed non-terminal stdin pipeline tests and updated non-terminal expectations to DetachSession behavior.
- Updated child_session_action behavior so non-terminal, non-pipeline stdin now yields DetachSession instead of None.
- Updated execute_external_command to skip process_group for detached children and move take_foreground into its foreground arm.
- Added async regression coverage for detached pipeline stages and logged the fix in the natives CHANGELOG.
2026-05-30 20:55:55 +02:00
oldschoola ae927b6f81 fix(pi-shell): unblock bash heredocs >4 KiB on Windows and >64 KiB on macOS
brush_core::interp::setup_open_file_with_contents wrote the entire heredoc/here-string body into an anonymous pipe synchronously before handing the reader to the downstream command. Bodies that exceed the OS pipe buffer (~4 KiB on Windows, 16-64 KiB on macOS) deadlocked the writer forever, and the bash tool tripped its 305 s hard timeout without ever launching the consumer. The Linux fast path still uses F_SETPIPE_SZ to grow the pipe inline; every other platform (and Linux bodies that overflow pipe-max-size) now decouples the write onto a fire-and-forget thread that terminates on drain or BrokenPipe.

Adds a 256 KiB regression test that exercises the worst-case shape (: builtin, which never drains stdin), guarded by tokio::time::timeout(10s) so a regression fails CI fast instead of hanging.
2026-05-26 20:12:39 +02:00