Skip to content

fix(session): bound apply_patch transcript metadata - #4573

Merged
Yeachan-Heo merged 2 commits into
devfrom
fix/issue-4566-apply-patch-transcript
Aug 15, 2026
Merged

fix(session): bound apply_patch transcript metadata#4573
Yeachan-Heo merged 2 commits into
devfrom
fix/issue-4566-apply-patch-transcript

Conversation

@Yeachan-Heo

@Yeachan-Heo Yeachan-Heo commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #4566 by bounding durable edit-result snapshot metadata independently of the edited file size.

Large EditToolDetails.oldText / newText bodies (including perFileResults[]) are replaced only at the session-persistence boundary with fixed-size { bytes, sha256 } receipts plus an externalization marker. Live in-process results keep complete bodies, preserving ACP diff rendering and editor consumers.

Near-limit managed appends now have a typed deterministic failure contract. The existing content_too_large rewrite recovery is verified; if the rewrite cannot durably hold the entry, SessionNearLimitAppendError states whether the entry/committed edit receipt remains resident and how to continue (/compact or gjc export).

Exact revision (refreshed 2026-08-15, third refresh — reconstruct onto current dev)

Overlap audit vs current dev deltas (through #4555)

Reproduction and result

Synthetic fixture: 464,979-byte source file, repeated one-line apply_patch updates.

  • Before: 943,242 durable bytes/patch (2.03x target file size)
  • After: 1,398 durable bytes/patch (0.003x target file size)
  • Live ACP-facing result still includes full old/new bodies
  • Persisted result retains diff/path/op/firstChangedLine plus exact byte-length/SHA-256 identities computed before generic 500k persistence truncation

Verification on refreshed head 055546bd38 (current dev 804314081f)

  • bun test packages/coding-agent/test/edit-result-persistence-bounding.test.ts — 6 pass, 0 fail
  • bun test ./packages/coding-agent/test/session-manager/ ./packages/coding-agent/test/session/ — 677 pass, 26 skip, 0 fail
  • Targeted batch (resident-cache, internal-details, blob-resume, resume-oversized, edit-per-file-diff-content, notifications-live-stream) — 50 pass, 0 fail
  • bun --cwd=packages/coding-agent run check:types — pass
  • bun --cwd=packages/coding-agent run build — pass (dist/gjc compiled)
  • bun scripts/verify-gjc-state-writers.ts --fail — pass (0 write sites outside sanctioned writers)

Review focus

  1. Is the persistence boundary the correct place to externalize full snapshot bodies while keeping live ACP fidelity?
  2. Does the typed near-limit path accurately preserve effect/receipt ordering without masking non-cap persistence failures?
  3. Are 16 KiB inline snapshots and SHA-256/byte-length receipts sufficient and appropriately bounded?

gajae.pr-review-verdict.v1 merge-approved sha256:1e0edc73077284c2539b7b6c37f10ed0fa772d90d6942d370f4885d0187b35f7 reviewer:human reviewer-id:probepark evidence:exact-head-055546bd38-current-dev-804314081f-fresh-independent-approval-by-probepark-2026-08-15T13:08:44Z-write-authorized-differential-review-5of6-fail-on-base-6of6-pass-on-head


[repo owner's gaebal-gajae (clawdbot) 🦞]

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

OWNER_CONFIRMATION_REQUIRED

Exact head 96754755ad41c95b03bcf9bb690cd4aeb9b4d366 / tree ce054b179e3aaa78982309ca5ecfade083d66b8f is implementation-validated and all product CI jobs in Dev CI run 31862850261 are terminal green, including:

The sole red job is intentionally the needs-human PR contract bootstrap. Canonical digest:
866540568b165d0d97f7e8538cbc7144f8985364b583895667c58077d3c9a36b

No authorized exact-head approval exists yet. Review requests are pending from probepark and HaD0Yun. This PR must remain unmerged until one authorized collaborator approves this exact head. After approval, the canonical verdict line must be changed in place to merge-approved using the actual reviewer identity, then bootstrap must rerun green.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@probepark probepark left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve at 96754755a

fix(session): bound apply_patch transcript metadata, head commit "hash edit snapshots before
truncation". 5 files, +898.

Differential

# base 96e718a2b, with this head's test file applied
(fail) near-limit edit append after committed mutation (#4566) > surfaces the typed near-limit outcome when even the rewrite cannot hold the entry
 1 pass  5 fail  1 error

# head 96754755a
 6 pass  0 fail
$ bun --cwd=packages/coding-agent run check   -> exit 0

Five of six fail on base, so the suite is genuinely bound to the change rather than passing
incidentally.

The ordering in the commit title is the correctness point

"hash edit snapshots before truncation" is not a detail. Hashing after truncation would make two
different patches collide whenever their surviving prefixes match, which is exactly the case that
matters here - large apply_patch payloads that get bounded for the transcript. Hashing the full
snapshot first and truncating for display afterwards keeps identity independent of the display
bound.

surfaces the typed near-limit outcome when even the rewrite cannot hold the entry is the assertion
worth having: the failure mode for a bounding change is not "too big" but "silently dropped or
mis-typed at the boundary", and this pins a typed outcome rather than a generic throw.

merge-approved.

Reviewed by @probepark - method: fresh-worktree run and package typecheck at the exact head, separate clean base worktree with the head's test file to prove the differential.

@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

Freshness dependency hold — current dev is red

This PR remains open at exact head 96754755ad41c95b03bcf9bb690cd4aeb9b4d366; its recorded base 96e718a2b0f2a46cad4876bf922886966c6fd0e3 predates current dev 290b31c110889f375c7713b3f64bd10c6338093e.

Current dev is not a valid green rebase target: push run 31867285336 fails the merge-induced Chrome default-root regression tracked by #4574. Existing exact-head product/review evidence is preserved but is not represented as current-base merge evidence. No unrelated rebase churn will be introduced onto a known-red base.

Disposition: item-specific hold remains active behind #4574. After #4574 merges and dev CI is green, this PR must be reconciled to that exact new dev head, with refreshed digest, CI, and review before any merge-ready claim.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo Yeachan-Heo left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OWNER_CONFIRMATION_REQUIRED

Reconciliation of exact head 96754755ad41c95b03bcf9bb690cd4aeb9b4d366 (tree ce054b179e3aaa78982309ca5ecfade083d66b8f) against current dev f024ded61408ee77c1fbcb20539146081a28e08d.

Merge reconciliation (clean, code conflict-free). Recorded base 96e718a2b0 predates dev by 3 merges (1cc986422a #4515, 2e3ccb589 #4577, f024ded61 #4579). git diff 1cc986422a..f024ded614 over the three touched source files (session-manager.ts, agent-session.ts, edit/renderer.ts) is empty — zero semantic overlap. Only CHANGELOG.md conflicts textually (both sides added entries to the same [Unreleased] block); merge resolution keeps both. I merged the exact head into a worktree at dev and verified green (below).

Adversarial review — no blockers found:

  • Digest receipts ({bytes, sha256}) are computed from the complete body before generic 500k persistence truncation (prepareEntryForPersistence{,Sync} ordering), so a receipt identifies the exact source body, not a truncated prefix. Pinned by a dedicated test.
  • Bounding is persistence-boundary-only. Live in-process results keep full bodies; ACP diff ToolCallContent consumes event.result off the live tool_execution_end stream, not the persisted entry, so editor/diff consumers are unaffected. Sub-16 KiB bodies persist verbatim with no receipt fields.
  • boundEditSnapshotFieldsForEntry gates on type === "message", role === "toolResult", non-array details; the walk only rewrites oldText/newText pairs over the cap and never mutates shared live objects (copy-on-change). Unrelated entries pass through untouched.
  • SessionNearLimitAppendError post-verification closes the prior silent-success gap: after the content_too_large rewrite recovery, the file is re-checked and a rewrite that still cannot hold the entry (or a rewrite that itself throws content_too_large) now throws the typed error instead of returning success without the receipt for an already-committed source edit. AgentSession maps it to a structured tool-result outcome with failureKind: "persistence" + nearLimitAppend fields; the entry stays resident so the next successful persist records it. Cost note: when the rewrite genuinely succeeds, the new getTranscriptFileBytes() verification is an extra stat — accepted for closing a durability gap.
  • Platform/lifecycle: sync and async persistence paths apply identical ordering; Windows/session-resume paths consume persisted entries read-only. No security-relevant surface change (transcripts get strictly smaller; digests add no new trust boundary).
  • Tests: 6 focused tests (bounding ratio < 2% of file size per patch, pre-truncation exact digest, sub-cap inline, multi-file perFileResults[], rewrite-recovery durability, typed-error surface). Attribution/changelog present and accurate against the diff.

Fresh verification on dev+PR merged tree: edit-result-persistence-bounding 6/6 pass; edit suites (per-file-diff-content, auto-generated-regressions, mode-auto-routing) 65/65 pass; session-manager persistence suites 21/21 pass; notifications-live-stream 20/20 pass; tsc -p packages/coding-agent clean. Minor nit (non-blocking): the new test file emits 11 biome warnings (unused type alias SessionNearLimitAppendError at L499, unused p/b/r params in the L543–555 proto stubs) — warnings, not errors; check stays green.

CI on the exact head: all product jobs green (affected plan, coding-agent check, focused #4566 regression, ts-build, CLI smoke, Windows regression, all gjc-state-gates). The red jobs are the intentional needs-human PR contract bootstrap/validation plus one superseded rerun. Automated reviewer probepark APPROVED at exactly 96754755a (write-permission collaborator).

Required owner action — this PR remains held on two gating conditions, both owner-owned:

  1. Freshness gate behind #4574/#4575. Current dev's own Dev CI is red from the pre-existing Chrome default-root regression (browser-chrome-profile.test.ts shard 3/8, failing on dev at 1cc986422 and 2e3ccb589, run 31876714691 in progress at f024ded61). That regression is unrelated to this PR's files and is repaired by open PR #4575 (189fc0fde6, rebased onto dev, its own CI green, awaiting merge). Per the standing hold recorded on this PR at 06:02Z: merge #4575 first, confirm dev Dev CI green, then rebase/merge-refresh this PR onto that exact dev head with fresh digest, CI, and review before any merge-ready claim. I verified locally that the dev-red test passes on the PR-merged tree and is untouched by this PR's diff.
  2. Exact-head contract approval. The PR contract bootstrap stays needs-human until an authorized non-author collaborator approves this exact head and the canonical verdict line is flipped in place to merge-approved with the actual reviewer identity, then bootstrap reruns green. probepark's approval exists; HaD0Yun's request is still pending.

No fix-forward was needed: the code is correct as-is against current dev, and pushing a rebase now would churn the exact head behind an authorized approval for no defect. Implementation is validated; disposition is blocked only on the two owner actions above, not on any code change.

Canonical verdict remains: gajae.pr-review-verdict.v1 needs-human sha256:866540568b165d0d97f7e8538cbc7144f8985364b583895667c58077d3c9a36b reviewer:human reviewer-id:pending evidence:exact-head-96754755-current-dev-f024ded6-reconciled-code-clean-dev-red-blocks-rebase


[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo
Yeachan-Heo force-pushed the fix/issue-4566-apply-patch-transcript branch 2 times, most recently from 1f83d5b to 186c948 Compare August 15, 2026 09:58
@Yeachan-Heo
Yeachan-Heo requested review from HaD0Yun and probepark and removed request for HaD0Yun August 15, 2026 09:58
@Yeachan-Heo

Yeachan-Heo commented Aug 15, 2026

Copy link
Copy Markdown
Owner Author

Head refreshed to current dev — prior approval intentionally invalidated

fix/issue-4566-apply-patch-transcript is force-updated with lease to exact head 186c948f7339867e1a39ed52fb947814f5f6df9c, rebased onto current origin/dev f35cf0e3a2e585e3b9f3b67badca8388675cb536 (base now contains #4570). New canonical digest: 935e5783be6b423841323b941dc4a36ec57367d053eb4a633d5ffa6194c737a2.

What changed and what did not:

Fresh verification on the refreshed head (local, current dev + delta): focused #4566 suite 6/6; test/session-manager/ + test/session/ 677 pass / 26 skip / 0 fail; 6-file targeted batch (resident-cache, internal-details, blob-resume, resume-oversized, edit-per-file-diff-content, notifications-live-stream) 50/50; check:types clean; build green; verify-gjc-state-writers --fail clean. Replacement CI is running on the new head; the verdict line in the PR body is updated to the new digest and stays honestly needs-human until an authorized non-author review lands on 186c948f73.

On the prior OWNER_CONFIRMATION_REQUIRED: the two conditions it named are now discharged or narrowed — the freshness hold is resolved by this rebase, and the remaining item is purely the exact-head independent review (implementation-risk questions were already settled by the tests/contracts above; no unresolved product decision is being parked). After approval lands, the verdict flips to merge-approved with the reviewer's identity and the contract check reruns; merge then proceeds.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo
Yeachan-Heo force-pushed the fix/issue-4566-apply-patch-transcript branch from 186c948 to 3b953cb Compare August 15, 2026 10:44
@Yeachan-Heo

Yeachan-Heo commented Aug 15, 2026

Copy link
Copy Markdown
Owner Author

Second head refresh to current dev 45885ea287 — sole-owner coverage re-established

The PR branch fix/issue-4566-apply-patch-transcript is force-updated with lease to exact head 3b953cb195d0be987929684166cae42ed796045b, rebased onto current origin/dev 45885ea28793b0ace3523272b41f7ad07b1e88e5 (now includes #4570 SDK positioned live events, #4575 Chrome default-root refusal, #4580 detached managed snapshots). New canonical digest: 42d5f7bdfbd0607c61a5e7dc9fcfbd9398f0ed37ecdbb7ba4125bdf3df298162.

Evidence of preserved semantics across the refresh:

Replacement CI is running on the new head. Fresh exact-head review requests are active for probepark and HaD0Yun; the PR body's single verdict line is updated to the new digest and remains honestly needs-human until a write-authorized non-author review lands on 3b953cb195. Prior stale approvals (probepark @ 96754755a) do not bind this head. On approval, the verdict flips to merge-approved with the reviewer's identity, the PR-contract check reruns green, and the PR squash-merges to dev with post-merge verification.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo

Yeachan-Heo commented Aug 15, 2026

Copy link
Copy Markdown
Owner Author

Replacement CI terminal on exact head 3b953cb195 — all product gates green

Dev CI run 31880322014 (head 3b953cb195d0be987929684166cae42ed796045b, base 45885ea287) is completed with the single expected red job: the intentional needs-human PR contract bootstrap. Every product gate is green:

  • Affected path validation (aggregate) + plan + evidence producer — success
  • check:@gajae-code/coding-agent — success
  • focused bug(session): apply_patch full-file result metadata exhausts the 64 MiB transcript during a live turn #4566 regression test:packages/coding-agent/test/edit-result-persistence-bounding.test.ts — success
  • test:session-manager-resident-cache / test:notifications-live-stream — success
  • ts-build — success; native-build — success; cli-smoke — success
  • all four gjc-state-gates (static, runtime, integrity, read) — success
  • Windows dev:doctor + session-path regression — success
  • Virtual integration validation — success

Run classification: 31880287136 was concurrency-cancelled by this replacement on the same head (plan had succeeded; native/shards/Windows cancelled; evidence producer failed closed as designed) and is not evidence. 31880322014 is the sole terminal product evidence for this head.

Remaining gate is the exact-head human review: zero reviews currently bind 3b953cb195. Fresh requests are active for probepark and HaD0Yun. On a write-authorized non-author APPROVED review at this head, the verdict flips to merge-approved with that review's identity, bootstrap reruns, and the PR squash-merges to dev with post-merge verification.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

Owner-controlled hold — exact-head review is the sole remaining gate

Sole-ownership coverage re-established after an SDK session reset. Live state re-read and bound before this post; no code or head change was made.

Binding (live, verified 2026-08-15T11:3xZ):

  • PR fix(session): bound apply_patch transcript metadata #4573 OPEN, not draft, MERGEABLE, base dev 45885ea28793b0ace3523272b41f7ad07b1e88e5 (== current origin/dev tip), head 3b953cb195d0be987929684166cae42ed796045b (== remote branch fix/issue-4566-apply-patch-transcript tip).
  • Canonical digest recomputed from a fresh worktree at the exact head: git diff --binary --full-index --no-ext-diff 45885ea287...3b953cb19542d5f7bdfbd0607c61a5e7dc9fcfbd9398f0ed37ecdbb7ba4125bdf3df298162 — byte-identical to the PR body verdict line. Source delta is unchanged from both previously reviewed heads (96754755ad, 186c948f73).

CI classification on the exact head (complete, no reruns):

  • Run 31880287136cancelled; same-head concurrency replacement of an in-flight run, not evidence.
  • Run 31880322014 — terminal and green on every product job: affected plan + evidence producer, check:@gajae-code/coding-agent, focused bug(session): apply_patch full-file result metadata exhausts the 64 MiB transcript during a live turn #4566 regression, test:session-manager-resident-cache, test:notifications-live-stream, ts-build, native-build, cli-smoke, Windows dev:doctor/session-path regression, all four gjc-state-gates, virtual integration validation. The single red job is the intentional PR contract bootstrap, whose log shows exactly Verdict needs-human intentionally blocks merge — the gate working as designed, not a defect. No fix-forward item exists; no stale/cancelled run is being rerun.

Review state (the gate):

  • Zero reviews bind 3b953cb195d0. Both existing reviews bind the stale head 96754755ad41 (probepark APPROVED; author COMMENTED) and do not carry over — the contract requires commit_id === headSha.
  • Active review requests: probepark, HaD0Yun — both verified permission: write, both non-author.
  • The author (this account) is barred from supplying the approval by the no-self-approval rule and by the bootstrap check itself (reviewer-id must differ from PR_AUTHOR). This is a genuine external-human gate; it cannot be discharged autonomously and will not be fabricated.

Standing instruction to reviewers: re-review at head 3b953cb195d0 (the source delta is byte-identical to the already-approved 96754755ad, rebased twice onto newer dev; overlap audit vs #4570/#4575/#4580 is in the second-refresh comment above). On a write-authorized non-author APPROVED review at this exact head, the canonical verdict line flips in place to merge-approved with that reviewer's identity, the bootstrap job reruns as part of the verdict edit, and the PR squash-merges to dev with post-merge verification (linked issue #4566 close check, dev tip check) — no other change is required or permitted before then.

Until that approval lands, this PR stays held in exactly its current state: no rebase churn onto a newer dev (any head change re-invalidates review/CI/verdict from zero), no verdict fabrication, no merge.


[repo owner's gaebal-gajae (clawdbot) 🦞]

Yeachan Heo added 2 commits August 15, 2026 12:10
Full-file oldText/newText snapshots made tiny edits consume roughly twice the target file size in managed transcripts. Persist bounded digest receipts instead and classify near-limit recovery when a committed edit cannot be recorded durably.

Lore-id: issue-4566-apply-patch-transcript

Constraint: preserve live ACP full-snapshot diff rendering while bounding durable transcript entries

Constraint: keep concurrent workflow-gate changes outside this commit

Tested: repeated large-file patches, multi-file receipts, sub-cap snapshots, near-limit effect/receipt recovery

Not-tested: full aggregate typecheck is independently blocked by concurrent WorkflowGateBroker.instanceId test changes

Confidence: high

Scope-risk: medium

Reversibility: clean-revert
Generic persistence truncation previously ran before snapshot receipt generation, so files above 500k could receive digests for truncated prefixes. Generate bounded edit receipts first and pin exact byte/hash identity beyond the generic cap.

Lore-id: issue-4566-exact-snapshot-digests

Constraint: preserve the bounded durable representation and live ACP bodies

Tested: exact SHA-256 and UTF-8 byte lengths for snapshots above 500k

Confidence: high

Scope-risk: narrow

Reversibility: clean-revert
@Yeachan-Heo
Yeachan-Heo force-pushed the fix/issue-4566-apply-patch-transcript branch from 3b953cb to 055546b Compare August 15, 2026 12:18
@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

Reconstructed onto current dev — third refresh, sole-owner coverage held

The PR was stale behind dev (base 45885ea287/head 3b953cb195 after dev moved to 804314081f). Reconstructed with a lease-protected force push; no other change.

New binding (live):

  • Head 055546bd38cf2ada32b6ad8f0b95ae2d74a2e13d, base dev 804314081fe9d3f4d34014d1385f09d8d49a7116 (== current origin/dev, includes fix(sdk): keep Windows OS probes and slow syncs off the session-index lock (#4544) #4555). Old base is an ancestor of the new dev — clean rebase, zero conflicts.
  • Canonical digest recomputed in a fresh worktree: git diff --binary --full-index --no-ext-diff 804314081f...055546bd381e0edc73077284c2539b7b6c37f10ed0fa772d90d6942d370f4885d0187b35f7 (PR body verdict line updated in place, still honestly needs-human, reviewer-id:pending).
  • Source delta unchanged: git patch-id --stable over the source paths is identical across the previously reviewed 3b953cb195 delta and the new 055546bd38 delta (65ba991bd763068218c1d939e7f2fd04f42fb1f0 both) — the reconstruction added no source change. Exactly five commit paths as before.

Fresh verification on the reconstructed head (local worktree):

  • edit-result-persistence-bounding — 6/6 pass
  • test/session-manager/ + test/session/ — 677 pass / 26 skip / 0 fail
  • Targeted batch (resident-cache, notifications-live-stream, session-manager-internal-details, blob-resume, resume-oversized, edit-per-file-diff-content) — 59 pass / 0 fail
  • check:types clean; verify-gjc-state-writers --fail clean (0 unsanctioned write sites)
  • A build-generated one-line whitespace artifact in packages/natives/native/index.d.ts was reverted; the pushed tree is source-exact.

Standing state: prior approvals remain void by contract (commit_id must equal head). Review requests to probepark and HaD0Yun (both write-authorized, non-author) carried over and are active. Replacement Dev CI is starting on this head; product gates are expected green; the bootstrap job stays intentionally red on needs-human until an authorized non-author APPROVED review lands at 055546bd38. On that approval: verdict flips to merge-approved with the reviewer's identity, bootstrap reruns, squash-merge to dev, #4566 close verified, receipt recorded. No self-approval, no stale-run rerun, no verdict fabrication.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@probepark probepark left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve at 055546bd3

Head moved since my approval of 96754755a; same change rebased onto 804314081, re-verified at
the exact head.

Differential

# base 804314081, with this head's test file applied
(fail) edit-result persistence bounding (#4566) > keeps transcript growth bounded independently of file size across repeated apply_patch results [5056.71ms]
(fail) edit-result persistence bounding (#4566) > computes snapshot receipts for generic 500k persistence truncation
(fail) edit-result persistence bounding (#4566) > bounds per-file copies in multi-file apply_patch results
(fail) near-limit edit append after committed mutation (#4566) > recovers the append via full rewrite, keeps the committed edit durable, and states the recovery path
(fail) near-limit edit append after committed mutation (#4566) > surfaces the typed near-limit outcome when even the rewrite cannot hold the entry
 1 pass  5 fail

# head 055546bd3
 6 pass  0 fail
$ bun --cwd=packages/coding-agent run check   -> exit 0

Five of six fail on base, and the first one fails as a 5-second timeout - unbounded transcript
growth showing up as a hang rather than an assertion mismatch.

The substantive review stands from my earlier pass: hashing edit snapshots before truncation keeps
identity independent of the display bound, so two different patches whose surviving prefixes match
cannot collide. keeps transcript growth bounded independently of file size is the assertion that
pins the actual product property rather than the mechanism.

merge-approved at 055546bd3.

Reviewed by @probepark - method: fresh-worktree run and package typecheck at the exact head, separate clean base worktree with the head's test file to prove the differential.

Yeachan-Heo pushed a commit that referenced this pull request Aug 15, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 15, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 15, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 15, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 15, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 16, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 16, 2026
The #4573 backport test hard-coded dev's 128 MiB managed-file cap;
main's base still uses 64 MiB. Asserting the exported constant keeps
the test correct on both bases.

Lore-id: 3f2a9c1e
Confidence: high
Scope-risk: narrow
Reversibility: trivial
Tested: edit-result-persistence-bounding suite, 6 pass
Yeachan-Heo pushed a commit that referenced this pull request Aug 16, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 16, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 16, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 16, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 16, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 16, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 17, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 17, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 17, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 17, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 17, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Yeachan-Heo pushed a commit that referenced this pull request Aug 17, 2026
Dev #4573 wired session-manager to the edit renderer for bounded
edit-snapshot receipts, which pulled renderer/streaming (and the
hashline barrel cycle) into session-manager's module-init order.
Any test importing the edit barrel or web-scrapers first then hit
'ReferenceError: Cannot access END_PATCH_MARKER before
initialization' (analogous handleYouTube/handleDockerHub TDZ),
failing dev shards 1-4/7-8 repo-wide.

Move the three pure receipt helpers into node-builtin-only leaf
edit/snapshot-receipt.ts; renderer re-exports unchanged;
session-manager imports the leaf. Discriminating regression test
pins barrel-first initialization.

Lore-id: issue-4593-edit-tdz
Constraint: no behavior change - renderer re-export is the same public surface
Tested: apply-patch-adverserial, safe-summary, package-managers-2, youtube, edit-result-persistence-bounding, session-manager suites, ci-dev-affected selftests, coordinator 18-suite set
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants