Commit Graph

3931 Commits

Author SHA1 Message Date
can1357 87a3b6ca03 refactor(patch): restructured chunk edit schema to use explicit op enum and anchor field
- Refactored chunk edit schema to use explicit `op` enum field (replace, delete, append, prepend, after, before) instead of multiple boolean/string flags.
- Renamed chunk edit parameters from `after`/`before` field names to `anchor` for sibling-relative insert operations.
- Simplified chunk edit validation logic by consolidating nested conditionals into switch statement on operation type.
- Fixed `log_experiment` to correctly identify run-modified files by removing pre-run dirty path filtering.
- Simplified chunk edit and read prompt documentation to emphasize read-first workflow with consolidated examples.
2026-04-07 05:53:40 +02:00
can1357 a30ee4a111 refactor(chunk): restructured path parsing and edit operations for cleaner CRC handling
- Simplified chunk path parsing to extract selector separately from CRC field.
- Refactored chunk edit operations to conditionally strip CRC for auto-accepted batch operations.
- Enhanced chunk edit preview formatting to display operation types with target and line ranges.
- Improved chunk state rendering with clamped visible range and unified notice message format.
- Refactored error handling in chunk resolution from map_err to let-else pattern.
2026-04-07 05:51:21 +02:00
can1357 567197c34e feat: added macOS power assertion module to prevent idle-sleep during sessions
- Added MacOSPowerAssertion native module to prevent idle-sleep on macOS during active sessions.
- Integrated power assertion lifecycle management into coding-agent session with automatic start/stop.
- Implemented N-API bindings for macOS IOKit power assertions with RAII cleanup and cross-platform no-op fallback.
- Reformatted indentation from spaces to tabs across Rust chunk module for consistency.
2026-04-07 05:51:21 +02:00
can1357 ad4c5917a4 refactor(chunk): restructured selector resolution and state lookup with unified classification
- Refactored chunk selector resolution to extract and preserve raw selector strings separately from parsed CRC checksums.
- Reorganized chunk state lookup infrastructure with dedicated maps for checksum, leaf, and suffix-based chunk resolution.
- Simplified batch operation CRC validation to auto-accept stale checksums for subsequent operations on the same chunk.
- Unified TypeScript interface and Nix attrset chunk classification with consistent naming and nested expression handling.
- Extracted clipboard utility functions to dedicated module with improved OSC 52 and Termux support.
- Updated chunk read formatting with anchorStyle parameter and ellipsis standardization for improved consistency.
2026-04-07 05:51:21 +02:00
can1357 3944b0f7f5 fix(chunk): auto-accepted stale batch CRCs for previously-touched chunks
- Removed error on stale CRC when a chunk was already modified by an earlier batch op; the model can only know the pre-batch checksum.
- `ensure_batch_operation_target_current` now returns `Ok(true)` to signal auto-accept, skipping redundant CRC validation.
- Updated prompt to clarify batched line-scoped edits are supported and to require fully qualified chunk paths.
2026-04-07 05:51:21 +02:00
can1357 0d8696702f refactor(chunk): simplified chunk edit API with flat schema and target#CRC format
- Replaced nested operation objects with a flat edit schema using a single `target` field.
- Merged `sel` and `crc` into a unified `target: "chunk#CRC"` string copied from read output.
- Replaced `operations` array with `edits` and added `append`, `prepend`, `after`, `before` fields for insert positioning.
- Removed `defaultSelector` and `defaultCrc` top-level params; CRC is now always explicit per-edit.
2026-04-07 05:51:20 +02:00
can1357 4681186507 fix(chunk): corrected namespace and module member addressability with recursion handlers
- Fixed namespace and module member addressability by adding dedicated recursion handlers for internal modules and namespace definitions.
- Fixed indent detection to scan source content as fallback when chunk metadata unavailable, improving robustness.
- Changed default indent character from tab to space for consistency with modern conventions.
- Added comprehensive test coverage for namespace member addressability, internal module recursion, and indent detection fallback logic.
2026-04-07 02:40:09 +02:00
can1357 a6c78612e9 fix(coding-agent): corrected chunk edit validation using embedded CRC checksums
- Fixed chunk edit operations to extract and use embedded CRC checksums from selectors as fallback validation.
- Refactored patch operations to parse selectors and strip CRC suffix before processing insert, replace, and delete commands.
- Extended parseChunkSelector to return optional CRC field extracted from selector suffix for validation.
- Improved operator precedence clarity in read tool by adding parentheses around nullish coalescing expression.
2026-04-07 02:05:30 +02:00
can1357 9b78a6fa85 refactor(natives): migrated native bindings to NAPI-RS with auto-generated types
- Migrated native bindings from TypeScript wrappers to NAPI-RS generated modules with auto-generated type definitions and runtime enums.
- Replaced chunk tree API with stateful ChunkState class supporting render, edit, and resolve operations with improved error handling.
- Converted callback signatures to error-first pattern (error, result) for shell, PTY, glob, and grep operations.
- Introduced type-safe enums for MacOSAppearance, GrepOutputMode, KeyEventType, ImageFormat, and AstMatchStrictness replacing string literals.
- Refactored chunk tree implementation with dedicated modules for edit, indent, resolve, and state management with comprehensive validation.
- Moved clipboard utilities from native bindings to coding-agent package with improved OSC 52 and Termux compatibility.
2026-04-07 02:00:59 +02:00
can1357 24a0d0ebde feat(chunk): added anchorStyle option and modernized render format
- Added `anchorStyle` setting ("full", "kind", "bare") to control anchor name verbosity in chunk output.
- Changed anchor tag delimiters from `` to `[…]` and gutter separator from `│` to `|`.
- Changed edit response to render only changed hunks with context instead of the full chunk tree.
2026-04-06 22:11:44 +02:00
can1357 3d17fd5ecb config(chunk): adjusted chunk rendering thresholds and recursion defaults
- Adjusted chunk rendering thresholds and preview line counts for improved display behavior.
- Updated MIN_RECURSE_SAVINGS default from 5 to 4 to optimize recursion handling.
2026-04-06 21:45:49 +02:00
can1357 20e60fba34 feat(coding-agent): enabled prose chunk rendering for markdown and text files
- Added `read.prosechunks` setting to enable chunk rendering for prose files (markdown, text, log, asciidoc, restructuredtext) in chunk edit mode.
- Added `read.explorechunks` setting to show chunk tree without checksums for read-only agents like explore.
- Implemented prose language detection and conditional chunk skipping logic based on file type and agent capabilities.
2026-04-06 21:21:01 +02:00
can1357 6c6e79f0a7 fix(chunk-tree): corrected zero-width insert indent detection logic
- Fixed zero-width insert detection to derive target indent from neighboring lines instead of replaced range.
- Improved indent selection for body-level insertions by picking deeper indent between two neighbors.
- Updated error messages to clarify insert vs splice operations and line range validation.
- Modified assertChecksum() return type to handle cases with default CRC and no explicit selector.
2026-04-06 20:59:19 +02:00
can1357 5e106e22db refactor(chunk): distributed AST classification to language modules
- Distributed language-specific AST classification logic from defaults module to individual language modules for 15+ languages.
- Simplified defaults module to minimal catch-all fallbacks, removing 341 lines of match-based classification logic.
- Consolidated chunk edit operations by removing splice operation and unifying with line-scoped replace parameters.
- Simplified chunk rendering output format by reducing thresholds and changing line count display from 'lines' to 'ln' suffix.
- Removed PI_CHUNK_SPLICES environment variable and chunkSplicesEnabled conditional logic throughout codebase.
2026-04-06 20:52:07 +02:00
can1357 79e2f8b2b1 feat(coding-agent): introduced keyed union format for chunk operations
- Changed chunk edit operation format from flat `op` field to nested keyed union structure with operation name as object key.
- Added parseKeyedChunkOp() function to normalize both keyed and legacy flat operation formats for backward compatibility.
- Enhanced chunk selector sanitization with filename prefix stripping and case-insensitive CRC checksum matching.
- Updated chunk edit prompt documentation and test suite to reflect new nested operation JSON structure.
2026-04-06 18:50:08 +02:00
can1357 266aabf29f feat(autoresearch): enabled selective segment creation and working tree preservation in experiments
- Added `new_segment` parameter to `init_experiment` to force new segment creation when contract fields match.
- Added `skip_restore` parameter to `log_experiment` to preserve working tree state and pre-existing uncommitted changes.
- Changed `log_experiment` to revert only run-modified files instead of entire working tree, preserving user changes.
- Changed `init_experiment` to detect matching contract fields and skip re-initialization unless `new_segment=true`.
- Added git status parsing utilities to track pre-run dirty paths and distinguish tracked vs untracked modifications.
- Removed secondary metrics validation requirement, making secondary metrics informational only.
2026-04-06 18:49:52 +02:00
can1357 49560bdc9b refactor(pi-natives): restructured config handling with env_uint! macro and scope validation
- Extracted environment variable parsing into centralized `env_uint!` macro for consistent configuration handling across modules.
- Refactored recursion logic to validate scope narrowing before recursing, introducing `recursion_narrows_scope()` and `MIN_RECURSE_SAVINGS` constant.
- Consolidated static configuration initialization from LazyLock to declarative `env_uint!` macro in render and cache modules.
- Improved control flow statement classification in defaults module by replacing positional candidates with named function-context candidates.
2026-04-06 18:48:41 +02:00
can1357 b93d1929db fix(edit-benchmark): corrected benchmark statistics by filtering ghost runs with zero activity
- Excluded ghost runs (failed runs with zero activity) from benchmark statistics to prevent skewed averages.
- Introduced isGhostRun() helper function to identify and filter runs with no tokens or tool calls.
- Updated report generation and task summarization to use nonGhostRuns for all metric calculations.
2026-04-06 18:48:15 +02:00
can1357 60e255f167 feat(ai): enabled literal null string preservation in JSON parsing
- Removed `coerceNullStrings` function and automatic null-string coercion from JSON parsing, changing behavior to preserve literal `"null"` strings.
- Updated `parseStreamingJson` to return parsed JSON without null-string transformation.
2026-04-06 18:46:07 +02:00
can1357 51467abc5a style(coding-agent): standardized indentation and added connection timeout to benchmark runner
- Fixed indentation and formatting across multiple files for consistency.
- Reformatted code blocks to use tabs instead of spaces and improved line breaks for readability.
- Added connection timeout configuration to benchmark runner for early abort on no events.
- Implemented two-phase timeout strategy in benchmark runner with connection and activity phases.
2026-04-06 18:45:41 +02:00
can1357 8718c62ea2 chore: update tests, lockfiles, and misc cleanups 2026-04-06 18:41:17 +02:00
can1357 273369859b chore(prompts): strengthen design-integrity cutover wording 2026-04-06 18:41:11 +02:00
can1357 e65e380409 feat(rpc): expose system prompt and tool schemas in get_state 2026-04-06 18:41:07 +02:00
can1357 3d292b0b49 refactor(autoresearch): overhaul tools, state management, and contract handling 2026-04-06 18:41:04 +02:00
can1357 54b379b8fe feat(grep): add chunk-aware grep output and clean up match formatting 2026-04-06 18:41:00 +02:00
can1357 4258ca3b8a feat(read): replace offset/limit with sel parameter for line ranges and chunk selectors 2026-04-06 18:40:56 +02:00
can1357 03fd34de63 feat(edit): add chunk edit mode with syntax-aware chunk-addressed edits 2026-04-06 18:40:51 +02:00
can1357 b5dfbe28ac feat(natives): add TLA+/PlusCal and Handlebars language support 2026-04-06 18:40:45 +02:00
can1357 791296669f fix(ai): coerce "null" strings in streamed JSON tool args 2026-04-06 18:40:40 +02:00
can1357 d1561beb99 refactor(edit-benchmark): migrated to typescript with in-process client support
- Migrated react-edit-benchmark package to typescript-edit-benchmark with pi-mono source repository.
- Added InProcessClient implementation to eliminate subprocess spawning overhead in benchmark runs.
- Extended benchmark configuration with chunk edit variant, retry limits, and conversation dump support.
- Refactored runner.ts to support both RPC and in-process client modes with improved error telemetry.
- Cleaned up 129 benchmark report files from react-edit-benchmark/runs directory.
2026-04-06 18:39:04 +02:00
can1357 d6059624d7 style(brush-core-vendored): standardized indentation and formatting across vendored crates
- Converted indentation from spaces to tabs throughout brush-core and brush-builtins vendored crates.
- Reorganized imports across multiple files for consistency and clarity.
- Removed clippy::too_many_lines suppression attributes from functions.
- Added too_many_arguments allow rule to Clippy configuration in Cargo.toml.
- Aligned struct field assignments and match arms for improved readability.
2026-04-06 18:37:11 +02:00
can1357 97e2acdf60 feat(lsp): added diagnostic versioning to suppress stale LSP results
- Added LSP diagnostic versioning support to track document versions and suppress stale diagnostics.
- Added options parameter to `waitForDiagnostics` and `getDiagnosticsForFile` with version filtering capabilities.
- Enabled `versionSupport` in LSP client capabilities to receive diagnostic version information from servers.
- Added test coverage for stale diagnostic suppression scenarios in LSP diagnostic freshness.
2026-04-06 01:16:26 +02:00
Can Bölük c9be206b64 Merge pull request #622 from apoc/fix/read-tool-internal-url-docs
docs(read): document internal URL schemes in read tool description
2026-04-05 18:50:31 +02:00
Miroslav Drbal f4346f95d4 docs(coding-agent): document mcp:// URI scheme in system prompt
The agent had no way to infer the mcp:// prefix needed to read MCP
server resources. Attempting <server>://<resource> directly fails.
All other internal URL schemes (skill, rule, memory, agent, etc.) are
already listed in the Internal URLs section of the system prompt.

Added mcp://<resource-uri>. URI resolution: exact resource listings
first, then RFC 6570 URI templates advertised by connected servers.
2026-04-05 18:30:23 +02:00
can1357 efbfa60517 fix(ci): restore Copilot 1M context and stabilize plan-role tests 2026-04-05 18:05:09 +02:00
can1357 d116b44b81 chore: bump version to 13.19.0 2026-04-05 17:38:13 +02:00
can1357 725aa3853d fix(ai): suppressed SDK console errors for malformed SSE frames
- Suppressed Anthropic SDK console errors for malformed SSE keep-alive frames to prevent noise in TUI output.
- Added logLevel configuration to AnthropicClientOptionsResult type and buildAnthropicClientOptions function.
2026-04-05 17:36:58 +02:00
can1357 3d29a48e7a fix(coding-agent): fixed memory leak by cancelling idle compaction
- Fixed memory leak by cancelling idle compaction timer on event controller disposal.
- Fixed session resumption to preserve last non-empty session when starting fresh.
- Fixed stash detection to use git ref resolution instead of output parsing for reliability.
- Fixed secret obfuscation to deobfuscate restored session messages locally while keeping LLM messages obfuscated.
- Fixed stash pop operation to preserve staged changes with --index flag after task branch merges.
- Changed idle compaction settings from enum to numeric type for flexible configuration.
2026-04-05 03:50:52 +02:00
Can Bölük ecffb06427 Merge pull request #621 from djdembeck/fix/exit-plan-mode-tool-concurrency
fix: set exclusive concurrency on exit_plan_mode tool
2026-04-05 02:04:43 +02:00
Can Bölük 6c42d9cc72 Merge pull request #618 from DeprecatedLuke/feat/auto-resume
feat(coding-agent): add auto-resume setting and ensure disk on new session
2026-04-05 01:20:53 +02:00
Can Bölük ae3d39b409 Merge branch 'main' into feat/auto-resume 2026-04-05 01:20:41 +02:00
Can Bölük 62080d2906 Merge pull request #614 from DeprecatedLuke/feat/secrets-hash-redaction
feat(coding-agent): switch secret placeholders to hash tokens
2026-04-05 01:19:51 +02:00
Can Bölük 9b92461fa2 Merge pull request #610 from loftiskg/loftiskg/fix-plan-mode-thinking-level
fix(plan-mode): propagate thinking level when entering/exiting plan mode
2026-04-05 01:19:45 +02:00
Can Bölük 0e6f03b97e Merge branch 'main' into feat/secrets-hash-redaction 2026-04-05 01:19:34 +02:00
can1357 b9df71db18 fix: ensure full persistence on ensureOnDisk and treat autoResume as continue 2026-04-05 01:19:18 +02:00
Can Bölük c178085158 Merge pull request #617 from DeprecatedLuke/feat/idle-compaction
feat(coding-agent): add idle compaction flow
2026-04-05 01:19:06 +02:00
Can Bölük 63625184d8 Merge branch 'main' into feat/idle-compaction 2026-04-05 01:18:59 +02:00
Can Bölük 168efc7443 Merge pull request #616 from DeprecatedLuke/feat/task-merge-back-safety
feat(coding-agent): preserve results on isolated merge failures
2026-04-05 01:18:19 +02:00
Can Bölük fb1d46a86c Merge branch 'main' into feat/task-merge-back-safety 2026-04-05 01:18:12 +02:00
agent 606fcb7ae2 fix: deobfuscate secrets on display copy only and include toolCall arguments 2026-04-05 01:18:11 +02:00