Skip to content

fix(updates): recover requested downloads and report durable app-update outcomes - #970

Merged
yaacovcorcos merged 13 commits into
mainfrom
claude/downloads-updates-20261116
Nov 17, 2026
Merged

yaacovcorcos merged 13 commits into
mainfrom
claude/downloads-updates-20261116

Conversation

@yaacovcorcos

@yaacovcorcos yaacovcorcos commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Keep managed-runtime downloads running while bytes arrive. Retain the 30-second idle bound, cancellation, reviewed size/digest checks, resumable prefixes and progress from retained bytes.
  • Recover only explicitly requested install/update/repair operations. Persist and revalidate the reviewed instance/driver/target, serialize retries, and give foreground work priority even during background discovery. Cancellation, removal, disabling and superseding choices clear the intent. Scient Agent auto-provisioning and third-party provisioning policy are unchanged.
  • Expose pending recovery separately from an active operation, including a usable Cancel retry control after restart. Preserve the longest remaining server Retry-After through source and compressed/raw fallbacks; durable backoff respects it (bounded at four hours).
  • Report bounded runtime download diagnostics; nonfailed lifecycle events carry no failureClass.
  • Add Essential app-update step outcomes and coarse summaries. A bounded desktop journal preserves original IDs/timestamps and waits for analytics SQLite-outbox acknowledgements. They follow the same rule as the rest of analytics since refactor: realign eight Scient rewrites onto T3's own code #988: recorded and replayed unless SCIENT_ANALYTICS_ENABLED is false or a managed policy denies telemetry; when off, nothing is recorded or replayed (including installer handoff with no ready backend) and an earlier journal is deleted.
  • Keep the updater poller alive after unexpected iteration failures; report apply/not-applied/superseded at next launch. Observation-record failure does not block installation. Approved downgrades are not counted as behind; failed checks retain unknown availability.
  • Strengthen the existing Windows publication policy: an unsigned candidate is rejected when a reachable Stable/Beta publisher-pinned client requires a signature. Preserve the explicit pre-pin unsigned policy rather than inventing a universal signing requirement. Revalidate publication pins after approval and serialize the cross-channel publication boundary.

Merged with main after #988 and #992

  • refactor: realign eight Scient rewrites onto T3's own code #988 removed Scient's analytics consent and deletion layer, and T3's AnalyticsService is upstream-identical again. This PR's consent check on update facts is gone; facts are gated only by SCIENT_ANALYTICS_ENABLED and managed policy, like every other event, and replayed events carry the same constant consent_level as record.
  • Replaying journaled facts no longer extends AnalyticsService. A Scient-owned ScientRecordedAnalyticsIngest reference is provided by ScientAnalytics.layer next to ScientAnalyticsAvailability; its default (no Scient analytics composed) settles facts as never sent. server.scient.test.ts asserts the composed server provides the real one.
  • No privacy text changed.

Dependencies and rollout boundaries

Verification

Separately exercised groups; counts are not additive:

  • Provider-runtime downloader/install suites: 147 tests passed.
  • Recovery manager/scheduler, managed actions, lifecycle analytics and real analytics-worker/SQLite suites: 120 tests passed.
  • Final real-manager/Agent-loop/store recovery checks: 71 tests passed, server typecheck passed, and commit hooks passed formatting/lint/full knip. Added coverage for shared-instance planning/cancellation, unavailable journals preserving bytes and blocking only managed changes, repair/restart, and startup pruning failures. Simulated-clock tests await durable transitions without weakening retry timing or stale-plan assertions.
  • Updater outcomes/journal and analytics contract/conformance after integration: 40 tests passed. Analytics-off launch and handoff cases passed in the focused rerun.
  • Chromium component scenario passed for active cancellation and pending Cancel retry after restart; the pending control was also visually inspected in the unstyled component harness. Temporary screenshot instrumentation was removed.
  • Full workspace typecheck passed (existing Effect schema-brand suggestions remain). Provider-runtime typecheck passed. Formatting, lint and full knip passed in commit hooks.
  • Desktop production build passed (five build tasks), followed by an isolated Electron launch/shutdown smoke test. The smoke does not prove native update application or complete renderer/backend readiness.
  • Gateway fixture parity: two conformance tests passed. Mirror source qualification: 32 worker tests and worker typecheck independently passed Codex's guard re-check; website full check passed separately.
  • Final publication-race/release-machinery checks: 34 tests passed; Codex independently reran them and the 10 journal/updater tests, finding no residual scoped defect. Scripts typecheck passed; actionlint retains exactly the four diagnostics also present on main.
  • CI exposed a stale publisher rehearsal fixture, not a production failure or timeout flake. Fixture-only correction 6bcdd01428 supplies the read token/candidate handoff and runs the real signing helper against synthetic public handoffs, including rejection when a new pin blocks an unsigned candidate. Both focused publication files passed 16 tests; the final rehearsal rerun passed 7 tests. Existing promotion/ownership/corrupt-upload assertions remain intact. CI on that head passed all 59 executed checks, with 13 skipped and no pending or failed checks.

Review and qualification limits

Codex reviewed the first-principles design and implementation; all reported source defects are closed. Final independent approvals cover mirror publication guards, updater privacy/signing/apply attribution, stacked feed composition, and recovery admission/journal isolation at 9e09eca3b1. The last reviewer independently reran all 71 recovery tests. The subsequent fixture-only correction is green in CI at 6bcdd01428. This PR is ready for review; no merge or release is requested.

Local runtime evidence is macOS arm64 with synthetic providers/files. Real-provider transfers, packaged native update application on macOS/Windows/Linux, and Windows Authenticode execution remain unqualified here. Journal restart and actual worker/SQLite persistence are tested separately; a single full transport scenario covering disconnect, lost ACK and queue pressure has not been exercised. The nonfatal listener warning was traced by review to overlapping Effect NodeTerminal test layers, not an unbounded downloader listener path.

Documentation impact

Updated existing provider lifecycle, product analytics, managed-update/release/Beta documentation and fork seam notes. The UI change is the pending-recovery cancellation control; Chromium evidence is described above. No new documentation page.

Checklist

  • Explained behavior, rollout boundaries and documentation impact
  • Meaningful boundary/state-transition checks without relaxing existing assertions
  • Explicit local evidence and cross-platform/native qualification limits
  • Final independent Codex reviews and finding closure
  • CI on final integration head 6bcdd01428 (59 passed, 13 skipped)

yaacovcorcos and others added 9 commits November 16, 2026 23:10
…ested runtime changes

Managed runtime downloads failed after ten minutes while bytes still
arrived, showed zero progress while resuming, and a user's install,
update or repair that failed transiently or was cut off by a restart
stayed failed until clicked again. Failed lifecycle events carried no
download diagnostics, and every lifecycle event carried failureClass.

- No overall transfer deadline for any managed runtime download; the
  30-second stall bound, cancellation, size limits, digest checks and
  resume stay. Applies to provider runtimes and the compute uv/Ark
  downloads that share the downloader.
- Progress starts from the kept prefix on every try and retry wait; the
  progress filter (now shared with Codex) reports a reset to zero.
- Durable recovery of user-requested runtime changes: the runtime
  manager records the reviewed plan per runtime and settles it on the
  outcome. A serialized loop retries it in the background at a jittered
  5 min, 30 min, 2 h, then every 4 h, after revalidating that the
  instance is enabled and still offers the same plan. Success, cancel,
  remove, disable or another user change clears it. Retryability is
  typed: exhausted 408/429/5xx and lost connections retry; 501,
  certificate, checksum, disk and permission failures do not. Scient
  Agent's own provisioning is unchanged.
- Download facts are captured after every failed try: source kind
  (scient_mirror/github/vendor), variant, inner tries, progress,
  active-transfer throughput, network kind (stall split from transport
  timeouts) and why a compressed copy was given up. The operation
  contract only gains optional fields, so older clients still decode
  it; a stall keeps failureClass "timeout" on the wire and analytics
  reports "stalled".
- failureClass only on provider.lifecycle.failed, in both the mapper
  and the contract normalizer; conformance fixture regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record one app.update.outcome per check, download, install and apply
attempt and app.update.summary at launch, on status changes and daily,
both Essential with closed values. Facts wait in a bounded persisted
desktop journal and travel on the desktopUpdateStatus pipe to one
backend, which queues them with their own ids and times and acknowledges
only after the outbox holds them. Nothing is kept while analytics is off.
The four-hour update poller survives an unexpected failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A signed Windows app pins its publisher: electron-updater installs a later
update only if the installer's signer CN matches publisherName in the installed
app-update.yml. An unsigned or differently signed release would then fail every
pinned client's update, on Stable and on Beta (clients switch channels).

- Build: the Windows signing attestation records the configured publisher
  (AZURE_TRUSTED_SIGNING_PUBLISHER_NAME) when signed.
- Native Windows verifier: a signed installer must be Valid, signed by that CN,
  and the packaged app-update.yml must pin exactly that name; an unsigned build
  must pin none.
- Handoff: records windows { signed, publisherName } for later gates.
- Publication gate: reads the newest published Stable and Beta handoffs; if
  either pins a publisher, the candidate must be signed by it and
  allow_unsigned_windows (including Beta's automatic exception) cannot override.
  Older handoffs carry no record and pin nothing, so today's unsigned releases
  keep working until the first signed one ships.

No job is added or renamed, so no required-check names change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…untime events

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

This PR changes the test suite by +45 test cases (browser 0, unit +28, server +17).

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.5 KiB 5.5 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 4.2 KiB 4.2 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.3 KiB 1.3 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 22.3 KiB 22.3 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.5 KiB 5.5 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 4.2 KiB 4.2 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.3 KiB 1.3 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 22.7 KiB 22.7 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Other scenarios

All 64 scenario measurements match main.

All 64 scenario measurements
Provider Scenario Metric Main baseline This PR Impact PR ceiling
Codex short turn resume WebSocket decoded 12.0 KiB 12.0 KiB 0 B (0.0%) 12.7 KiB ✅
Codex short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn running, cold open HTTP decoded 281.7 KiB 281.7 KiB 0 B (0.0%) 302.7 KiB ✅
Codex long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Codex long turn running, history page HTTP decoded 92.4 KiB 92.4 KiB 0 B (0.0%) 107.4 KiB ✅
Codex long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Codex long turn finished, cold open HTTP decoded 381.5 KiB 381.5 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, socket cold open WebSocket decoded 381.6 KiB 381.6 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, work page HTTP decoded 186.2 KiB 186.2 KiB 0 B (0.0%) 200.2 KiB ✅
Codex long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Codex idle thread resume WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell snapshot HTTP decoded 45.5 KiB 45.5 KiB 0 B (0.0%) 53.7 KiB ✅
Codex fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Codex fleet shell subscribe WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Codex fleet shell resume check rows 0 0 0 0 ✅
Codex stale shell reload HTTP decoded 45.5 KiB 45.5 KiB 0 B (0.0%) 53.7 KiB ✅
Codex stale shell reload rows 27 27 0 (0.0%) 27 ✅
Codex stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Codex stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex stale todo list cold open HTTP decoded 72.4 KiB 72.4 KiB 0 B (0.0%) 83.0 KiB ✅
Codex stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Codex stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅
Claude short turn resume WebSocket decoded 12.2 KiB 12.2 KiB 0 B (0.0%) 12.7 KiB ✅
Claude short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn running, cold open HTTP decoded 283.3 KiB 283.3 KiB 0 B (0.0%) 302.7 KiB ✅
Claude long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Claude long turn running, history page HTTP decoded 93.4 KiB 93.4 KiB 0 B (0.0%) 107.4 KiB ✅
Claude long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Claude long turn finished, cold open HTTP decoded 384.1 KiB 384.1 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, socket cold open WebSocket decoded 384.3 KiB 384.3 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, work page HTTP decoded 188.1 KiB 188.1 KiB 0 B (0.0%) 200.2 KiB ✅
Claude long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Claude idle thread resume WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell snapshot HTTP decoded 46.1 KiB 46.1 KiB 0 B (0.0%) 53.7 KiB ✅
Claude fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Claude fleet shell subscribe WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Claude fleet shell resume check rows 0 0 0 0 ✅
Claude stale shell reload HTTP decoded 46.1 KiB 46.1 KiB 0 B (0.0%) 53.7 KiB ✅
Claude stale shell reload rows 27 27 0 (0.0%) 27 ✅
Claude stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Claude stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude stale todo list cold open HTTP decoded 73.4 KiB 73.4 KiB 0 B (0.0%) 83.0 KiB ✅
Claude stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Claude stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅

Baseline: 50cb80c · PR result: e89536a · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Bounded compact HTTP snapshot with live cursor.

  • Codex decoded thread snapshot: 88.2 KiB
  • Claude decoded thread snapshot: 88.4 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@yaacovcorcos
yaacovcorcos marked this pull request as ready for review November 16, 2026 22:58
yaacovcorcos and others added 2 commits November 17, 2026 08:50
Brings in #988 (consent and deletion layer removed) and #992 (T3 through
e9a1e86). Desktop update facts now follow the same rule as the rest of
analytics: kept and sent unless SCIENT_ANALYTICS_ENABLED is false or a managed
policy denies telemetry. Replaying recorded events moves off T3's
AnalyticsService (now byte-identical to upstream) onto a Scient-owned
ScientRecordedAnalyticsIngest reference provided by ScientAnalytics.layer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yaacovcorcos
yaacovcorcos added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 7a439f7 Nov 17, 2026
94 checks passed
@yaacovcorcos
yaacovcorcos deleted the claude/downloads-updates-20261116 branch November 17, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant