Repository navigation
Conversation
Two follow-ups from the binpatch adoption: 1. **Bump packages/gateway binpatch from ^0.1.0 to ^0.3.0.** 0.3.0 brings the per-HTTP \`instrument\` hook (added in BYK/binpatch#4) so the gateway can plug in its own per-fetch telemetry without losing the now-deleted full-package coverage. Stable channel gets githubReleaseSource({fetch: customFetch}); nightly gets ghcrSource({fetch: customFetch}). The instrument hook is wired into the existing logging spans. 2. **Apply bar shows percentage only (not bytes).** Multi-hop chain totalBytes sums newSize across hops, which inflates the displayed size beyond the actual final binary (e.g. a 3-hop 310 MB chain shows 930 MB total — visually alarming when the resulting binary is 310 MB). The user lands at "how far along is this?" — percentage answers that without the scare. \`format: "pct"\` is a new parameter to makeByteProgress that drops the bytes/total portion of the line and keeps the rendered bar + percentage only. Full-binary download bar still uses bytes (it is actual bytes). Tests: 12/12 progress + delta-upgrade-telemetry pass on first run. TYPE=0, lint clean (only pre-existing unbound-method warnings in test/sync-cmd.test.ts, which we did not touch).
Contributor
Codecov Results 📊❌ Patch coverage is 66.67%. Project has 6569 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 76.03% 76.03% —%
==========================================
Files 172 172 —
Lines 27407 27409 +2
Branches 19670 19673 +3
==========================================
+ Hits 20838 20840 +2
- Misses 6569 6569 —
- Partials 1999 1999 —Generated by Codecov Action |
BYK
added a commit
that referenced
this pull request
Jul 28, 2026
Pick up the published binpatch@0.3.1: - 0.3.1: semver-guard fix (no longer throws on malformed/incomparable nightly patch tags) - 0.3.0: per-HTTP `InstrumentHook` for telemetry/tracing - 0.2.0: injectable `fetch` for custom CA / proxy / test injection Fully backward-compatible additive surface since 0.1.0 — gateway imports (`makeCache`, `PatchCache`, `DeltaResult`, `PatchChain`, `ghcrSource`, `githubReleaseSource`, `resolveAndApply`, `ProgressEvent`, `SourceStrategy`) are unchanged. No code changes in gateway; only dependency bump. Verified: gateway typecheck clean, delta-upgrade tests (5) pass, frozen lockfile install succeeds. This supersedes the stalled PR #1503 (which also added a pct progress mode + regression test); this PR keeps scope tight to the dependency bump only.
BYK
added a commit
that referenced
this pull request
Jul 28, 2026
…1519) Multi-hop chains sum newSize across hops, so the apply bar's byte total can far exceed the final binary (e.g. 930 MB shown for a 310 MB install). Switch the apply progress bar to format='pct' so users see only the percentage, not a scary inflated byte count. - progress.ts: makeByteProgress gains format: 'bytes' | 'pct' (default bytes), adds the percentage-only render branch. - delta-upgrade.ts: apply bar now passes 'pct'. - progress.test.ts: regression test for pct-only rendering. Extracted from the now-obsolete PR #1503 (which also tried to bump binpatch to ^0.3.0 — already superseded by #1515 @ ^0.3.1); this carries only the progress feature. Test: 7 passed.
BYK
added a commit
that referenced
this pull request
Jul 28, 2026
Multi-hop chains sum newSize across hops, so the apply bar's byte total can far exceed the final binary (e.g. 930 MB shown for a 310 MB install). Switch the apply progress bar to format='pct' so users see only the percentage, not a scary inflated byte count. - progress.ts: makeByteProgress gains format: 'bytes' | 'pct' (default bytes), adds the percentage-only render branch. - delta-upgrade.ts: apply bar now passes 'pct'. - progress.test.ts: regression test for pct-only rendering. Extracted from the now-obsolete PR #1503 (which also tried to bump binpatch to ^0.3.0 — already superseded by #1515 @ ^0.3.1); this carries only the progress feature.
Owner
Author
|
Closed as obsolete — both halves of this PR were merged separately:
Nothing in #1503 is missing from main now. Thanks for the original write-up. |
BYK
added a commit
that referenced
this pull request
Jul 29, 2026
Multi-hop chains sum newSize across hops, so the apply bar's byte total can far exceed the final binary (e.g. 930 MB shown for a 310 MB install). Switch the apply progress bar to format='pct' so users see only the percentage, not a scary inflated byte count. - progress.ts: makeByteProgress gains format: 'bytes' | 'pct' (default bytes), adds the percentage-only render branch. - delta-upgrade.ts: apply bar now passes 'pct'. - progress.test.ts: regression test for pct-only rendering. Extracted from the now-obsolete PR #1503 (which also tried to bump binpatch to ^0.3.0 — already superseded by #1515 @ ^0.3.1); this carries only the progress feature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two follow-ups to the binpatch adoption:
packages/gatewaybinpatchfrom^0.1.0to^0.3.0— brings the per-HTTPinstrumenthook (added in BYK/binpatch PR publish: BYK/opencode-lore@0.3.1 #4) into the gateway. Stable channel getsgithubReleaseSource({ fetch: customFetch }); nightly getsghcrSource({ fetch: customFetch }). The instrument hook is wired so each named HTTP step is wrapped in a per-fetch tracing span (defense-in-depth against the 12withTracing("http.client", …)spans we previously inlined indelta-upgrade.ts).format: "pct"parameter onmakeByteProgressdrops the bytes portion of the line, keeps the bar + percentage only. Full-binary download bar still uses bytes (it is actual bytes).Diff
Why
format: "pct"matches the earlier agreement (PR feat(upgrade): TTY progress bars for delta-patch apply and full download #1442 design notes) that the apply bar should report progress without inflating the displayed size via summed intermediate hops.Tests
pnpm run typecheck— exit 0 (only@loreai/corehad to be built once locally; pre-existing build-order issue, unrelated to this PR).pnpm run lint— clean for the files touched; the only output is pre-existingunbound-methodwarnings intest/sync-cmd.test.ts(file not modified).pnpm exec vitest run packages/gateway/test/progress.test.ts packages/gateway/test/delta-upgrade-telemetry.test.ts— 12/12 pass.[████████] 100%after 3×310MB inputs against a 930 MB total (multi-hop scenario).Wire-up
After merge:
binpatch@0.3.0(same wire contract: TRDIFF10 magic,patch-<version>tag scheme,from-version/sha256-<binaryName>annotations, constantsMAX_STABLE_CHAIN_DEPTH=10,MAX_NIGHTLY_CHAIN_DEPTH=30,SIZE_THRESHOLD_RATIO=0.6,MAX_OUTPUT_SIZE=2 GiB). Requires a fresh gateway rebuild to take effect on the running binary.Notes
format: "pct"parameter is opt-in and defaults to"bytes"— full-binary download bar (upgrade.ts:308) keeps its byte display unchanged.