Skip to content

fix(files): accept rendered read output in edits and resolve indirect PDF lengths (#939, #788) - #1005

Closed
Nicholas023 wants to merge 3 commits into
mainfrom
fix/file-edit-pdf
Closed

Nicholas023 wants to merge 3 commits into
mainfrom
fix/file-edit-pdf

Conversation

@Nicholas023

Copy link
Copy Markdown
Collaborator

Closes #939, #788

What was wrong

The change

  • ops_edit_file: raw oldText match keeps precedence and never decodes newText; only a raw miss tries the reversible rendering decode for both oldText and newText, reports renderedMatches, and preserves ambiguity/CAS failures. write_file stays byte-verbatim.
  • The PDF reader resolves indirect /Length through the classic xref table in either object order, keeping cycle, depth, type, size and mismatch refusals and the existing budgets.
  • Docs: edit contract in file batching/native range pages, PDF subset in the native kernel page; bilingual changelog entries.

Local validation: file-escaped-edit 5/5, pdf-indirect-length 3/3, native-ranges 4/4, Rust document/file unit tests, check:size 825 files all ≤1000 lines.

Validation

$ npm run build
build: compiled src/ to lib/ and copied 60 assets

$ node scripts/verify-gate.mjs --skip-install --keep-going
268 suites passed; skipped: linux-attributes, linux-shell, tui-host, tui-native (allowed: file-metadata, linux-attributes, linux-shell, tui-host, tui-native)
manifest: 92/59 checks
win32-x64: gate green

The gate lines above were produced on the local integration head b21274dd (all slices merged) with the pinned local fixtures:
DSH_OPS_TEST_BASH = a verified pinned MSYS bash (sha256 6cc575e9…), DSH_OPS_NIUBASH_ARCHIVE = the shipped frozen archive. Each PR branch was also built and its own suites were run before push; the counts below are from those runs.

CI required run: the pull_request event for this PR triggers ci.yml; paste the aggregate CI required run URL here once it finishes.

Environment

  • OS: Windows x64 25H2; Node.js v24.21.0; DSH 0.2.2-rc.1
  • Based on upstream main commit 58f6e281 (origin/main at submission)
  • Install channel: local source build (npm ci --ignore-scripts --offline, npm run build, npm run stage:niubash -- --offline --archive <frozen archive>)

@Thatgfsj

Copy link
Copy Markdown
Collaborator

Superseded by #1033:按仓库约定把 #1023 与 #1002–#1008 合并为一个统一 PR(冲突已在 #1033 内解决,CI 在 #1033 上跑)。

@Thatgfsj Thatgfsj closed this Nov 20, 2026
Thatgfsj added a commit that referenced this pull request Nov 20, 2026
- cargo fmt: the three merged native branches had unformatted code (rust-lint red
  on #1005, #1006 and #1023); run rustfmt over the workspace.
- file_path_tests: pin the canonical temp path before walking, so macOS's
  /var -> /private/var symlink no longer turns the asar-member expectation into
  PATH_RESTRICTED (darwin legs were red on #1006).
- drop the dead imports/comments left by the superseded P7 step-tail provider
  (prompt-injection, resident-switch, ptc.ts).

Refs #1032, #1033.
@Thatgfsj
Thatgfsj deleted the fix/file-edit-pdf branch November 20, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants