Commit Graph
250 Commits
Author SHA1 Message Date
can1357 480d40f2a8 fix: corrected optional edit path fallback across chunk hashline modes
- Added raw read output propagation so read/archive commands bypass anchors, line numbers, and chunk formatting.
- Fixed atom/hashline editing by tightening hashline prefixes and applying grouped anchor edits in stable order.
- Hardened chunk parsing and path handling by using `bigram_end` checks and resolving edit paths via shared `args.path` fallback.
- Updated path-related behavior for chunk, replace, patch, and hashline previews to honor optional edit paths.
- Removed mode-level param validators and replaced them with runtime handling, then removed obsolete validation tests.
2026-04-26 00:29:18 +02:00
can1357 0260d27fbe refactor(pi-natives): migrated pi-native hashline checksums to bigrams
- Migrated `chunk_checksum` to emit 4-char checksums from `HASHLINE_BIGRAMS` bigrams.
- Updated selector handling in `resolve.rs` to normalize CRCs to lowercase and validate two-bigram tokens.
- Updated `hashline_prefix_len` to require ASCII two-character bigrams from `HASHLINE_BIGRAMS` in hashlines.
2026-04-26 00:29:17 +02:00
can1357 bcb494c4fc fix(brush-core-vendored/sys): detached non-terminal command children into new sessions
- Added a new `CommandSessionExt::detach_session` extension trait on Unix, Windows, and stub command backends.
- Updated external command execution to use `detach_session` when spawning a new process group without terminal stdin.
- Implemented Unix detaching via `pre_exec(setsid)` with `EPERM` handled as a non-fatal condition.
2026-04-25 18:26:27 +02:00
can1357 e5c48e7ab6 fix(pi-natives/chunk): added fallback indent computation for preserved replacement body
- When inferred body indentation was empty, the replacement path now falls back to compute_insert_indent for the effective indent.
- The body indentation logic now uses this computed effective indent when indenting non-empty normalized lines.
- Existing inferred indentation is still used unchanged when available, preserving prior behavior.
2026-04-24 23:06:55 +02:00
can1357 99a21b95ba feat(pi-natives-chunk): enabled row chunk support in pi-natives-chunk
- Added markdown `Row` chunk support by introducing `ChunkKind::Row`, mapping it to tag `"row"`, and emitting row chunks for table rows.
- Updated Go chunk parsing to support method signatures (`func (recv) Name`), prefer method parsing in signatures, and adjust root rules to classify package/import chunks correctly.
- Changed chunk-edit behavior to add read-only `read:true`, replace `write:null` deletes with explicit `delete`, and require one explicit action per entry.
- Added safer chunk-edit execution with region matching, replacement reindentation, table-row append handling, and stricter warnings/errors for boundary and invalid operations.
2026-04-24 21:26:56 +02:00
can1357 83e897d5ea fix(pi-natives-chunk): corrected chunk edits to reject invalid ^/~ ops
- Fixed chunk edits to reject invalid `^`/`~` operations on code-leaf chunks.
- Fixed multiline replacement behavior to preserve literal insertion text and adjust multiline match starts.
- Fixed unsupported-region handling to warn, fall back to whole-chunk edits, and clear invalid region targets.
- Documented chunk-edit behavior for raw whitespace, parser boundaries, `sel="?"` refresh, markdown spacing, and streaming headers.
2026-04-24 19:56:42 +02:00
can1357 b3515410f7 fix(chunk): corrected batch edit checksum remap and stale-target errors
- Tracked batch edit targets across operations to remap reused checksums to the current chunk path.
- Ensured later batch operations fail with clearer diagnostics when a previous target was removed.
2026-04-24 15:34:13 +02:00
can1357 ec8405bb2c fix(pi-natives/shell): resolved shell minimizer bypass for compound/piped
- Updated minimizer mode selection so `Compound`, `Piped`, and `Unsupported` plans now skip minimization.
- Removed `MarkedCommands` mode and marker-stripping paths from shell minimizer and buffering flow.
- Updated minimizer tests and changelog to document compound/piped commands bypassing minimization.
- Deleted marker metadata and helper infrastructure (`markers.rs` types/helpers) and related imports.
2026-04-24 14:00:04 +02:00
can1357 e4ee83000c refactor(pi-natives/chunk): replaced unstable suffix trimming in chunk node kind sanitization
- Replaced the `sanitize_node_kind` suffix-removal chain with a `strip_suffix` loop to drop unsupported legacy helper usage.
- Removed the crate-level `#![feature(trim_prefix_suffix)]` gate and the `specialization` feature from the smallvec dependency configuration.
2026-04-24 13:48:33 +02:00
can1357 c61a5b9a56 feat(config): added minimizer output fields and compact shell summaries
- Added minimizer API fields (`MinimizerResult.text`, `settingsHash`) and shell options for minimized output behavior.
- Changed bash execution to print minimized text output and append artifact footers only after minimized output is saved.
- Added UTF-8-safe shell streaming with `on_chunk` callback routing and `replace()` output sink updates.
- Added core filter enhancements for git, cargo, go, and listing/python outputs to produce compact summaries.
- Added RTK command filters and fixtures to strip noise, truncate output, and normalize success fallbacks.
2026-04-24 11:13:43 +02:00
can1357 18231ce151 fix: resolved command completion marker and exit-code handling
- Added command-marker metadata and lifecycle in process execution, including completion markers and exit-code writes.
- Refactored minimization to support `MarkedCommands` mode, token-based detection, and marker-aware stripping.
- Added `onMinimizedSave` and `saveBashOriginalArtifact` to persist full bash-original output artifacts.
- Expanded public exports and marker hooks so external command launch metadata can be controlled by consumers.
2026-04-24 09:51:00 +02:00
can1357 992924ba58 refactor(pi-natives/shell): simplified shell minimizer command planning
- Simplified shell minimizer control flow in command planning and pipeline handling using cleaner `let else` and `if let` patterns.
- Marked checksum and plan-classification helpers and the minimizer transformed-output constructor as `const fn` to enable compile-time use.
- Retained existing minimizer output semantics while adjusting generated filter docs and build-time concatenation writing style.
- Use.
2026-04-24 09:37:11 +02:00
can1357 de67835e68 chore: reformat 2026-04-24 09:28:35 +02:00
can1357 e905898ae3 fix(pi-natives-chunk): patched apply-edits to stop batch on checksum fail
- Prevalidated each operation in `apply_edits` via `schedule_edit_operation` before execution.
- Aborted the entire batch immediately when initial checksum validation failed for an operation.
- Replaced touched-path CRC auto-acceptance with checksum-based lookup in `unique_current_chunk_by_initial_checksum`.
2026-04-24 09:27:20 +02:00
can1357 084ffd2058 feat(cross-cutting): added shell minimizer planning from AST command parsing
- Added AST-based minimizer planning with brush-parser to classify commands before minimization.
- Added original text capture and byte-metric `minimized` telemetry to shell execution results.
- Added minimizer configuration controls, including trust-gated loading via `settingsHash` and limits.
- Added `onMinimizedSave` callback wiring to persist minimized outputs and annotate Bash sinks with artifact IDs.
2026-04-24 09:15:18 +02:00
can1357 151934e9a1 feat(minimizer): added builtin minimizer defs and compact output tests
- Added built-in minimizer definition files for many CLI tools with corresponding tests for compact output behavior.
- Added build-time generation of combined `builtin_filters.toml` and sorted minimizer definition loading.
- Added minimizer config/pipeline schema handling with `settings_hash` gating, `user_pipelines`, and mismatch fallback behavior.
- Implemented compiled pipeline engine with regex validation, match/output/exit controls, and overlay execution.
- Extended `MinimizerOutput` with input/output byte metrics and updated filters to pass input size into transformed outputs.
2026-04-24 08:55:00 +02:00
can1357 781c2f40fa fix(pi-natives/shell): corrected minimizer non-zero exit passthrough
- Added passthrough handling for non-zero exits and raw/metadata outputs in docker, helm, cloud, listing, and system filters.
- Expanded minimizer routing to support bun run/exec, gt status/diff, npx extras, and pnpm-dlx handling.
- Updated git, go, and cargo handling to preserve important outputs (status trees, show/stash cases, tool subcommands, metadata).
- Improved pkg and python filters to keep security/audit and pytest summaries, including location-followup lines.
- Added Ruby RSpec JSON parsing to emit condensed summaries, example sections, and exception context.
- Refined chunk selector/edit tests by asserting CRC flags directly and adjusting selector/CRC error message formatting.
2026-04-24 08:22:31 +02:00
can1357 20ccf49044 fix(chunk): resolved chunk selector multi-CRC ancestor matching
- Captured inline per-segment checksums in selector parsing and preserved trailing-CRC semantics.
- Allowed multi-CRC edits to resolve when any provided checksum matched an ancestor chunk checksum.
- Added tests for multi-CRC selector parsing and ancestor-match acceptance/rejection.
2026-04-24 08:01:02 +02:00
can1357 4940961e01 feat: added shell minimizer settings and dispatch by program
- Added configurable minimizer settings to native and coding-agent APIs, including shellMinimizer options.
- Added minimizer execution plumbing through shell config, session-key generation, and buffered output capture.
- Added command identity detection and dispatching by program/subcommand with safe fallback to passthrough output.
- Added filter suites for git, docker, go, bun, cloud, and system commands to strip ANSI and compact noisy output.
- Added unit tests for detection and minimizer behavior across command support, failures, and passthrough paths.
2026-04-24 08:00:04 +02:00
can1357 f5e69ea37f chore: reformat 2026-04-24 07:18:17 +02:00
can1357 b0eb26e315 fix(pi-natives/shell): translated MSYS PATH segments into Windows-style paths
- Added detection of Git install roots from registry and where-lookup results to resolve MSYS-style path segments.
- Rebuilt PATH normalization to translate existing and added Git paths, deduplicate normalized entries, and preserve Windows entries.
- Removed the old path membership helper and added tests for MSYS translation and Windows-path handling behaviors.

Fixes #608.
2026-04-24 07:10:31 +02:00
can1357 727090e72c chore: reformat 2026-04-24 05:55:44 +02:00
can1357 e17d26fcf0 chore(pi-natives): shorten chunk path prefixes and cap identifiers at 3 chars
Reduces MAX_IDENT_CHARS from 6 to 3 in chunk path name truncation and
shortens the ChunkKind prefix strings (e.g. class->cls, array->ar,
body->b) so chunk paths stay compact across all supported languages.
Updates fixture expectations in ast_ipynb/edit/indent/resolve tests.
2026-04-24 05:48:34 +02:00
can1357 eab9178330 fix(pi-natives): preserved exact brace unions without adding recursive glob prefix
- Updated glob pattern construction to skip prepending the recursive `**/` prefix for exact brace unions wrapped in `{}`.
- Added an `is_exact_brace_union` helper that detected brace-only unions without wildcard or bracket meta-characters.
- Added tests covering `{alpha.txt,beta.txt}` as non-recursive and `{*.ts,*.tsx}` as still receiving the recursive prefix.
2026-04-24 05:19:15 +02:00
can1357 ad569dbec5 Merged PR #758 2026-04-24 00:03:59 +02:00
0fflineuserandcan1357 18ca636f8f feat: Add dart support for ast_grep and ast_edit 2026-04-23 22:59:29 +02:00
can1357 c96f15b6da fix: preserve glimmer schema generation 2026-04-23 22:55:42 +02:00
Trevor Smithandcan1357 eef22705ec fix: resolve tree-sitter-glimmer arm64 undefined symbol error
The published tree-sitter-glimmer v0.0.1 crate has its external scanner
compilation commented out in build.rs. The vendored workaround compiled
scanner.c into a separate static library, which causes a linker symbol
resolution failure on arm64: undefined symbol
tree_sitter_glimmer_external_scanner_create.

Replace the vendored workaround with a [patch.crates-io] pointing to
upstream v1.6.0 (which compiles scanner.c correctly in its own build.rs)
and remove the vendor directory and cc build dependency.

Fixes #651, fixes #727
2026-04-23 22:50:46 +02:00
can1357 d0b500d94a style: format grep.rs 2026-04-14 11:33:49 +02:00
can1357 a2fcf84c8b fix(pi-natives/grep): respect node_modules in glob pattern when scanning directories 2026-04-14 11:31:53 +02:00
can1357 3260dcd829 refactor(pi-natives): reworked fs cache APIs to use ScanOptions
- Added `ScanOptions` to `fs_cache` and replaced separate scan booleans with a shared struct for cache keys and scan entry points.
- Updated ast, fd, glob, and grep call sites to construct and pass `scan_options` through `get_or_scan` and `force_rescan`.
- Adjusted fs_cache tests to pass explicit `ScanOptions` instances with the new API.
2026-04-13 21:27:38 +02:00
can1357 5caddcebd6 feat(cross-cutting): added fd crate export and moved fuzzy-find bindings
- Removed `SearchDb` APIs and `searchDb` fields, dropping db-backed state from native and agent sessions.
- Replaced crate export `fff` with `fd`, moving fuzzy-find bindings into `fd.rs`.
- Removed `SearchDb`/picker fast-path logic from `glob` and `grep`, simplifying scan flow and dropping db args.
- Removed `SearchDb`/`getSearchDb` wiring from extension, tool, and task context constructors across coding-agent.
- Added over-indentation validation warnings in chunk-edit normalization for suspicious `~` body line formatting.
- Removed `bytes`, `fff-grep`, `fff-search`, and `blake3` deps, adding `grep-searcher = "0.1"`.
2026-04-13 21:25:50 +02:00
can1357 b69dea4823 refactor(pi-natives-cache/search): restructured node-modules scan cache
- Added skip_node_modules to cache keys and scan calls, preventing stale cache reuse across policies.
- Updated build_walker to filter .git and optionally prune node_modules during traversal.
- Threaded skip-node-modules decisions through ast, glob, grep, and fff scan paths for consistency.
- Adjusted get_or_scan and force_rescan to honor the same skip-node_modules policy.
- Added tests verifying node_modules and .git behavior in walker, collect_entries, and force_rescan.
2026-04-13 13:04:25 +02:00
can1357 0534320f27 fix(brush-core-interpreter): addressed pipeline spawn gating in interp
- Added `should_try_spawn_pipeline_as_job` to gate job spawning logic in `spawn_ao_list_as_job`.
- Prevented background job creation for pipelines with extras, bang modifiers, aliases, builtins, or funcs.
2026-04-13 13:04:18 +02:00
can1357 6b96198a5f feat(pi-natives/brush-core): added chunk put op for scoped replacement
- Added `ChunkEditOp::Put` as a native operation and exported it via generated Rust/JS bindings.
- Separated replace semantics so `replace` now performs scoped literal `find` replacement and `put` handles full-target replacement.
- Added indentation-aware matching and replacement in `apply_find_replace` to preserve matched block indentation.
- Removed runtime controls `PI_CHUNK_ALWAYS_RECURSE` and `PI_HIDE_CLOSING_TAGS`, making chunk recursion and anchors deterministic.
- Refactored async execution in `interp.rs` to spawn eligible pipelines as explicit jobs via `spawn_ao_list_as_job`.
- Changed chunk anchor rendering to `@`-style markers with depth dashes and removed emitted closing chunk tags.
2026-04-13 12:26:29 +02:00
can1357 655a3bffea feat(coding-agent): added multi-file edits in coding-agent with per-entry payloads
- Added multi-file edit payload support by requiring per-entry `edits` arrays across patch, hashline, replace, and chunk modes.
- Changed edit schemas and validators to move `path` (and `sel`->`path`) and op data into each edit entry.
- Changed edit execution flow to parse `file:selector` paths, run single-entry executors per file, and return grouped per-file results.
- Updated chunk diff rendering and test expectations to emit consistent anchor gutters with spaced pipes and `^` head-line markers.
2026-04-13 06:59:01 +02:00
can1357 f1cb3d8121 fix(pi-natives/chunk): preserved chunk anchors for deleted inline hunks
- Captured pre-edit chunks by path so deleted hunks can be matched to their owning chunk when no new anchor exists.
- Introduced marker-aware inline hunk lines and threaded them into chunk rendering so deleted chunks emit a deleted-anchor line.
- Updated focused edit rendering tests to assert the changed chunk chain is emitted without sibling context and deleted variants keep their anchors.
2026-04-13 06:19:36 +02:00
can1357 e992ba6d4e feat(pi-natives/chunk): implemented chunk grep tree output for safe edit
- Added hierarchical chunk grep output grouped by directory, file, and chunk with aligned chunk anchors.
- Updated chunk rendering to show clipped head/tail context with explicit truncation and expand markers.
- Changed chunk edit and streaming validation to use chunkToolEditSchema-based checks for safe edit detection.
- Enhanced grep rendering to use structured ChunkedGrepMatch data with displayPath and chunk checksum metadata.
2026-04-13 05:43:18 +02:00
can1357 5989fbf0d3 merge: PR #669 2026-04-13 00:31:38 +02:00
can1357 4750b523be feat(pi-natives/chunk): added parse-error line metadata support to chunk edits
- Added parse_error_lines to ChunkTree and threaded parse-error line metadata through tree creation.
- Changed count_parse_errors to return (count, line numbers) and collect recursive parse-error positions.
- Added hashline edit input resolution so computeHashlineDiff accepts loc/content edits and throws on invalid payloads.
- Fixed apply_edits error rendering to fall back to full-tree context when edited chunks have downstream parse errors.
2026-04-11 20:30:24 +02:00
can1357 ea652888c7 fix(pi-natives/chunk): corrected chunking to recurse JSX returns for tag
- Skipped JSX opening/closing nodes as structural trivia so they no longer leak into chunk paths.
- Classified JSX returns to recurse into returned element trees, exposing nested `tag` chunks instead of opaque leaves.
- Propagated forced-recursion through child candidates so JSX wrapper parents do not collapse their meaningful children.
- Updated recursion heuristics to recurse when a child is already marked `force_recurse`, preserving nested scope.
2026-04-11 16:07:13 +02:00
can1357 8c7d394f37 feat(pi-natives/chunk): added markdown/html chunking for injected code
- Added language-aware chunking for Svelte, Vue, Astro, and HTML script/style tags using `lang` aliases.
- Added markdown/html markup handling for fenced code and HTML blocks with detected injected languages.
- Added injected-subtree chunk infrastructure and build-time merge logic in `pi-natives/chunk`.
- Added tests for markdown and script-chunking embedded-language behavior in chunk-tree and chunk-mode suites.
2026-04-11 11:06:00 +02:00
can1357 90338f4dc6 test: updated the gemini-image test harness to use
- Updated the gemini-image test harness to use CustomToolContext, ModelRegistry, and ReadonlySessionManager types.
- Expanded getHeaderValue in gemini-image tests to handle string-array header values.
- Adjusted the resolve.rs stale-selector test to use a let-else Err(err) binding.
- Clarified the fence_marker doc comment to describe CommonMark triple-marker detection semantics.
2026-04-11 05:55:31 +02:00
can1357 77c8bf6e82 fix(chunk): corrected fenced code block indentation preservation and file validation
- Fixed markdown fenced code block rendering to preserve literal indentation instead of normalizing to tabs.
- Added validation to reject chunk selector operations on non-existent files with descriptive error message.
- Fixed chunk deletion to properly derive parent paths and mark ancestors with appropriate focus modes.
- Simplified path segment matching logic by removing unnecessary normalization of requested_segment parameter.
- Added comprehensive test coverage for fenced code block caret reads, indentation preservation, and file-not-found error handling.
2026-04-11 03:43:53 +02:00
can1357 7bf0e59d44 perf(coding-agent): optimized image compression with aggressive payload reduction strategy
- Reduced default image size limits to 1568px and 500KB to match Anthropic's internal thresholds.
- Optimized screenshot compression with 1024px max dimensions, 150KB budget, and 70% JPEG quality for aggressive payload reduction.
- Added fast-path optimization to skip re-encoding when images fit dimensions and are within 25% of byte budget.
- Refactored image encoding strategy to JPEG-only in quality/dimension reduction loops with improved quality ladder steps.
2026-04-11 03:42:26 +02:00
can1357 011dcadd43 fix(chunk): corrected region fallback for chunks without boundaries
- Corrected region selection logic to fall back to whole-chunk read when chunks lack real region boundaries (markdown fenced blocks, leaf chunks without prologue/epilogue).
- Prevented empty region error messages when using `^` selector on chunks without defined boundaries.
2026-04-11 03:19:14 +02:00
can1357 4ab4ca6d3b feat(chunk): added full-path selector resolution for unique chunks
- Added full-path selector resolution to match untruncated chunk identifiers when they resolve uniquely.
- Extracted path segment matching logic into reusable functions for improved maintainability.
- Added test coverage for full untruncated identifier path resolution.
2026-04-11 02:57:05 +02:00
Bonobo e8255b97af Merge upstream/main into research/native-illegal-instruction 2026-04-11 01:43:07 +02:00
Bonobo 94c4c026cf fix(natives): eliminate unsafe avx512 x64 release artifacts
Fixes #601
2026-04-11 01:26:00 +02:00
can1357 0394213f9d fix(chunk): corrected stale chunk selector resolution with CRC fallback matching
- Added fallback logic to resolve stale chunk selectors by matching same-parent CRC when exact selector not found.
- Fixed stale child selector reuse to match chunks by checksum for sibling chunks with identical names.
- Added condition to check for Section chunk kind with Replace operation in region nullification logic.
- Expanded documentation with critical warnings about chunk name truncation and guidance for markdown editing with whitespace preservation.
2026-04-10 22:52:16 +02:00