Skip to content

Alias web release/assisted-update wire types to the server definitions - #863

Merged
selfcontained merged 1 commit into
mainfrom
agt_224bcbc351a0/job-debt-collector-5afa4468
Aug 1, 2026
Merged

Alias web release/assisted-update wire types to the server definitions#863
selfcontained merged 1 commit into
mainfrom
agt_224bcbc351a0/job-debt-collector-5afa4468

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

What

Consolidates the last of the server<->web wire-type trio (jobs #856, templates #860): the release SSE stream types and the assisted-update cluster.

  • New leaf module apps/server/src/server/release-wire.ts holds the wire types (ReleaseJob, ReleaseProgress, ReleaseStreamEvent, RELEASE_VERSION_TYPES, phase unions). release-runtime.ts re-exports them, so server importers are untouched.
  • apps/web/src/hooks/use-release-stream.ts drops ~150 lines of hand-copied type definitions and import types the server definitions instead (release-wire, assisted-update-store, release-metadata, release-checks, update-migrations, update-migrations-evaluator, release-info), re-exporting under the exact names web consumers already use — zero importer changes, zero runtime change (esbuild erases type-only imports; finalize:web proves it).
  • release-info.ts now imports ReleaseProgress from the wire module instead of release-runtime.ts.

Why the leaf module

release-runtime.ts imports generated/runtime-assets.js, which only exists after prepare:runtime-assets runs — the server check runs it, web's does not. A direct web import would make check:web fail on a fresh checkout. The leaf-module-plus-re-export shape is the same one used in #844/#849.

Why it qualifies as tech debt

The web copies had already drifted from the wire: web's AssistedUpdateState was missing the token field the server actually broadcasts, typed phase/notes against the too-broad ReleasePhase union, and AssistedUpdateMetadata.requiredChecks lost the server's ReadonlyArray. One definition ends the drift.

Validation

  • pnpm run check green (all packages)
  • pnpm run finalize:web green
  • pnpm run test green (2366 server / 541 web / 60 misc)
  • pnpm run test:e2e green (175 passed)

Observation (not in scope)

The release SSE stream broadcasts the full AssistedUpdateState including token (the nonce the assisted-update agent uses to authenticate phase POSTs) to all connected release-stream clients. The typing change just makes this visible; worth a separate look at whether the stream should redact it.

Queued next

Top of backlog: consolidate the three duplicated git helpers (resolveRepoRoot/resolveCurrentBranch/normalizePath) in apps/server/src/shared/.

🤖 Generated with Claude Code

The release SSE stream types (ReleaseJob, ReleaseProgress,
ReleaseStreamEvent, phase unions) and the assisted-update cluster
(AssistedUpdateState, AssistedUpdateMetadata, UpdateMigrationManifest,
check types) were maintained as ~150 lines of hand-copied definitions in
apps/web/src/hooks/use-release-stream.ts, and had already drifted: the
web copy of AssistedUpdateState was missing the token field the server
actually sends, and typed phase/notes/requiredChecks more loosely than
the wire.

The wire types now live in a new leaf module
apps/server/src/server/release-wire.ts (release-runtime.ts re-exports
them, so server importers are untouched), and web imports them
type-only, re-exporting under the names web consumers already use. The
leaf module is required because release-runtime.ts imports
generated/runtime-assets.js, which only exists after
prepare:runtime-assets runs — web type checking doesn't run that.
release-info.ts now takes ReleaseProgress from the wire module so web
can reach ReleaseChannel without traversing release-runtime.ts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@selfcontained
selfcontained merged commit 437f1d2 into main Aug 1, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_224bcbc351a0/job-debt-collector-5afa4468 branch August 1, 2026 09:19
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.

1 participant