Commit Graph

285 Commits

Author SHA1 Message Date
can1357 d50cc4e2d3 feat(coding-agent): made hashline seen-line guard opt-in via edit.enforceSeenLines
- Added the `enforceSeenLines` option to hashline `PatcherOptions` (defaults `true`); the seen-line guard in `Patcher` now runs only when enabled.
- Added the `edit.enforceSeenLines` coding-agent setting (default off) and wired it through `edit/hashline/execute.ts` into the `Patcher`.
- Stopped `file-snapshot-store` excluding column-clipped (>512-char) lines from a snapshot's seen set, so single-line edits on long lines apply without a full-width re-read.
- Updated `seen-line-guard` tests and the hashline/coding-agent changelogs.
2026-07-15 15:15:08 +02:00
can1357 7d02778c60 chore: bump version to 16.5.2 2026-07-15 00:04:32 +02:00
can1357 14b5da76a9 chore: bump version to 16.5.1 2026-07-14 19:21:54 +02:00
can1357 a3960bb4e1 chore: bump version to 16.5.0 2026-07-14 01:32:16 +02:00
can1357 da24614d5a feat: added scrollback rebuild controls and prewalk status-line visibility
- Added `tui.scrollbackRebuild` configuration with interactive startup/controller wiring to apply `setScrollbackRebuild`.
- Exposed prewalk session state in `SegmentContext` and rendered a dedicated prewalk segment/icon in the status line.
- Added divergence-aware TUI full-paint logic that enables scrollback erase-and-replay rebuilds for non-multiplexer divergence cases.
- Updated rendering and streaming tests to verify rebuild behavior (`3J`) and eliminate stale marker expectations under drift scenarios.
2026-07-14 00:39:34 +02:00
can1357 a886a30901 feat(hashline): standardized drift recovery using anchor remapping
- Replaced 3-way-merge and session-chain replay strategies with a consistent anchor remapping flow for drift recovery.
- Removed legacy reconciliation logic and associated session-replay warning constants.
- Updated recovery flow to mandate anchor consistency and validate against duplicated context.
- Refined test suite to verify anchor mapping mechanics and explicit refusal of ambiguous remappings.
2026-07-13 16:23:00 +02:00
can1357 e45796908b feat(hashline): implemented strict validation for boundary repairs
- Introduced strict validation for boundary repairs to prevent accidental code deletion when payload context is insufficient.
- Added `ambiguousBoundaryEchoMessage` to identify when a partial echo is too short to safely replace a range.
- Added `ambiguousCloserSpareMessage` to identify when a spare closer replacement lacks structural evidence (indentation or delimiter balance) for placement.
- Implemented rejection logic in `repairReplacementBoundaries` for ambiguous cases, forcing the user to provide explicit edits instead of guessing.
- Added test cases covering one-sided echo and ambiguous closer sparing to ensure errors trigger on unsafe edits.
2026-07-13 10:37:21 +02:00
can1357 01d3fc9b6b chore: bump version to 16.4.8 2026-07-12 20:48:09 +02:00
can1357 f933f02fcf chore: bump version to 16.4.7 2026-07-12 13:06:27 +02:00
can1357 12466ecf40 chore: bump version to 16.4.6 2026-07-12 02:50:43 +02:00
can1357 3d1f9a4a3c chore: bump version to 16.4.5 2026-07-11 19:50:41 +02:00
can1357 cf1b3fc3fb chore: bump version to 16.4.4 2026-07-11 12:30:26 +02:00
can1357 f7930048d5 chore: bump version to 16.4.3 2026-07-11 07:55:17 +02:00
can1357 fd2d4616a6 chore: bump version to 16.4.2 2026-07-11 00:17:35 +02:00
can1357 395e4a5fcf chore: bump version to 16.4.1 2026-07-10 20:50:59 +02:00
can1357 a0f7266fbc chore: bump version to 16.4.0 2026-07-10 14:11:05 +02:00
can1357 e8d0a93db6 chore: bump version to 16.3.15 2026-07-09 22:44:35 +02:00
can1357 5ddb0719ad chore: bump version to 16.3.14 2026-07-09 20:37:29 +02:00
can1357 dd67447a03 chore: bump version to 16.3.13 2026-07-09 19:39:55 +02:00
can1357 f25ab54c59 chore: bump version to 16.3.12 2026-07-08 19:40:13 +02:00
can1357 b086c5d669 chore: bump version to 16.3.11 2026-07-06 17:48:50 +02:00
can1357 d8e568fad1 chore: bump version to 16.3.10 2026-07-06 08:13:30 +02:00
can1357 674cf01762 chore: bump version to 16.3.9 2026-07-06 04:19:29 +02:00
can1357 d806ac5e4c chore: bump version to 16.3.8 2026-07-05 19:43:28 +02:00
can1357 0ca345185c chore: bump version to 16.3.7 2026-07-05 16:58:53 +02:00
can1357 98f6e9f004 chore: bump version to 16.3.6 2026-07-04 14:00:53 +02:00
can1357 fef9b62334 chore: bump version to 16.3.5 2026-07-04 05:19:15 +02:00
can1357 d0c1890a6c chore: bump version to 16.3.4 2026-07-03 06:37:14 +02:00
can1357 afc79e4cda chore: bump version to 16.3.3 2026-07-03 00:57:22 +02:00
can1357 c983918c30 chore: update changelogs 2026-07-02 23:49:32 +02:00
can1357 1301d5b07a Merge remote-tracking branch 'origin/farm/f5b6b32e/fix-edit-anchor-fresh-read' 2026-07-02 23:43:10 +02:00
can1357 0059aed4f0 feat(hashline): enabled content hash matching to resolve tag collisions
- Simplified match logic to rely exclusively on content hash equality.
- Removed strict validation that rejected colliding snapshot tags.
- Updated recovery behavior to resolve collisions to the most-recently recorded snapshot.
- Refactored tests to expect successful preview and patching despite tag ambiguity.
2026-07-02 22:45:29 +02:00
can1357 9e0b6cddf2 chore: bump version to 16.3.2 2026-07-02 17:50:38 +02:00
roboomp 367a002e48 fix(hashline): column-cap revealed anchor lines and gate merge on width truncation
Codex reviewer flagged that the per-reveal cap only limits the line
count, not each line's width. A minified-bundle-style wide line
(megabytes on one row) would be stored verbatim in the RevealedLine
and formatted straight into the thrown edit error — bypassing the
column-truncation read/search already apply to long lines and dumping
that much content into the tool result, TUI, and model context.

assertSeenLines now clips each revealed line at
SEEN_LINE_REVEAL_MAX_COLUMNS (512, matching search's DEFAULT_MAX_COLUMN)
with a trailing ellipsis marker and treats any clip as truncated. The
existing truncated-gated merge keeps the guard closed on clipped
reveals so the model cannot land an edit having only seen the first
512 chars of a wide line, and the message keeps the range-re-read
guidance.
2026-07-02 08:20:47 +00:00
roboomp f42fa38f7c fix(hashline): do not merge revealed seen-lines on the truncated path
Codex reviewer flagged that when an anchor range exceeds
`SEEN_LINE_REVEAL_CAP`, merging the revealed prefix into `seenLines`
lets a model split a blind over-cap edit into two <=cap-line retries
and slip past the range-re-read gate: attempt 1 reveals+merges lines
100-139, attempt 2 reveals+merges the 140-159 tail, attempt 3 applies
— all without a single range read.

The merge is now gated on `truncated === false`: only a reveal that
covered EVERY unseen anchor line joins `seenLines`. Truncated reveals
keep the range-re-read guidance and the reveal window stays anchored
at the head across retries, so the same over-cap patch keeps rejecting
until the model actually re-reads the range.
2026-07-02 08:11:16 +00:00
roboomp 72a30af57c fix(hashline): reveal seen-line-guard content and merge into snapshot on reject
Structural-summary reads (default for parseable code >100 lines) mint a
`[path#tag]` that only marks declaration/boundary lines as displayed;
edits anchored inside an elided body then hit `#assertSeenLines` in
`packages/hashline/src/patcher.ts` and reject with "never displayed
(it showed a partial range, a search hit, or a folded summary)". The
existing message pointed at a range re-read, but that made every such
recovery a three-turn round-trip (edit-fail → range read → edit-retry)
and models frequently retried the same edit instead of following the
hint — 5-8 out of 10 edits failed for the reporter.

The rejection now:
- Inlines the actual file content at the unseen anchor lines, from
  `matchedSnapshot.text` (which by definition equals the live normalized
  content on the no-drift path), up to `SEEN_LINE_REVEAL_CAP` (40) lines.
- Merges the revealed lines into the snapshot's `seenLines` set, so a
  straight retry with the same `[path#tag]` header succeeds without a
  follow-up read. The content is inside the error the model receives,
  which is the proof it has now seen those lines.
- For anchor ranges over the cap, only the revealed prefix is merged;
  the message keeps the range-re-read guidance for the remainder so
  runaway blind edits don't sneak past.

Fixes #4224
2026-07-02 08:05:12 +00:00
can1357 0ea6ea630b chore: bump version to 16.3.1 2026-07-02 09:00:04 +02:00
can1357 36cfb54e92 chore: bump version to 16.3.0 2026-07-02 04:12:21 +02:00
can1357 c4c0331345 fix(coding-agent/session): prevented data loss in session serialization
- Persist signed message blocks (`text`, `thinking`, `toolCall`) and encrypted reasoning payloads verbatim during session serialization instead of clearing or truncating them.
- Preserve signature keys instead of replacing them with empty strings when they exceed persistence size limits.
- Exempt official first-party OpenAI and Anthropic API endpoints from the leaked-thinking stream healing wrapper to prevent misfires on legitimate visible text fences.
2026-07-02 03:58:10 +02:00
can1357 3128eab271 chore: update changelogs 2026-07-02 03:08:59 +02:00
can1357 5dcf2ad197 chore: cleanup 2026-07-02 03:08:16 +02:00
can1357 0fb1dcbc1a Merge remote-tracking branch 'origin/farm/edc4af0a/markdown-edit-escape-prompt' 2026-07-02 02:03:01 +02:00
can1357 b821aa977e fix(hashline): introduced collision-safe tag lookup by exact hash
- Added `byHashExact` to `SnapshotStore` to resolve historical versions only when a tag is unambiguous.
- Prevented recovery and edit-preview paths from incorrectly applying anchors against colliding tags.
- Implemented `InMemorySnapshotStore.byHashExact` returning null when multiple recorded versions share a tag.
- Added comprehensive unit tests validating single-match resolution and multi-collider rejection.
2026-07-02 01:51:09 +02:00
can1357 f5d090829f refactor(hashline): optimized anchor validation and added collision safety
- Accelerates duplicate-line verification from quadratic $O(N^2)$ to linear $O(N \log N)$ by precomputing anchor neighbors in a single sorted pass.
- Optimizes duplicate checks to $O(1)$ by collecting line values into a pre-allocated Set instead of repeatedly searching arrays.
- Prevents silent content corruption by aborting recovery if multiple historical snapshots share the same 16-bit hash tag.
- Validates the optimized duplicate-line shifting behavior and collision rejection logic with new test coverage.
2026-07-02 01:51:09 +02:00
roboomp cf5150568f fix(edit): taught markdown bullet escaping
Clarified hashline minus-row errors and model-facing prompt examples so Markdown list rows use the + body-row prefix instead of triggering write fallbacks.

Fixes #4179
2026-07-01 22:15:53 +00:00
can1357 5f1ed0fcde chore: reformat 2026-07-01 23:14:36 +02:00
can1357 efee86afe5 fix(hashline): reject ambiguous colliding snapshot tags 2026-07-01 21:53:16 +02:00
can1357 28843ec015 Merge PR #4113: fix(hashline): guarded against 16-bit snapshot tag collisions (@roboomp) 2026-07-01 21:53:15 +02:00
can1357 4c751c48a8 fix(hashline): validate unique stale anchor remaps 2026-07-01 21:42:26 +02:00
can1357 3e4ac085aa Merge PR #3778: fix(hashline): recover stale edit anchors after line shifts (@roboomp) 2026-07-01 21:42:26 +02:00