Repository navigation
v0.1.3
Bounded codemode diffs
This patch release bounds the extension's snapshot, diff-storage, and rendering costs for large writes and edits without changing file mutations or model-facing tool results.
Safety budgets
| Stage | UTF-8 bytes | Logical lines |
|---|---|---|
| Each previous/new write input, before diff generation | 256 KiB | 2,000 |
| Each retained write/edit diff | 64 KiB | 2,000 |
| Total retained diffs per parent codemode call | 256 KiB | 8,000 |
- Omit an entire diff when either limit is exceeded; show an explicit reason and available previous/new file byte sizes instead of a partial diff.
- Bound actual snapshot reads to 256 KiB plus one overflow-detection byte, even when a file grows after its size is checked. Skip reading the previous content when the new content is already over budget.
- Apply shared storage budgets to both writes and edits, with separate budgets for parallel parent codemode calls.
- Apply the same display limits to oversized diffs in older resumed sessions without rewriting those session files.
- Keep exact written bytes, tool success/failure, model-facing results, and direct write behavior unchanged. The edit tool's own diff computation is not modified.
These limits bound the extension's retained diff payloads, not all tool arguments, metadata, or the total size of a long session. Omitted diffs cannot be recovered by expanding the view. No full-content hash or backup is generated for an omitted write.
cwd regression protection
Add a regression test proving that the same direct-write wrapper follows a changed execution-context cwd without reloading the extension, while preserving the old workspace and native results. No cwd implementation change is included.
Validation
npm run typecheckpassed.- 88 tests passed; 1 optional actual-PiG-runtime loader test was skipped because
PIG_NODE_RUNTIME_DIRwas not provided. - Tests cover byte/line boundaries, multibyte text, short reads, file growth after stat, per-diff and parent budgets, write/edit budget sharing, omission rendering, unchanged tool outcomes, session persistence/resume, and loading the packed npm artifact through real Pi.
git diff --checkpassed.- PiG compatibility unit tests passed; the actual PiG executable was not revalidated for this release.
Install
pi install git:github.com/hyein-cbio/pi-codemode-diff@v0.1.3
pig install git:github.com/hyein-cbio/pi-codemode-diff@v0.1.3Run /reload in an existing session after upgrading.
The attached npm tarball contains source, README, license, and the manifest; dependencies are declared rather than bundled. npm registry publication is a separate manual step and has not been performed as part of this GitHub release.