Alias web Template type to server TemplateRecord - #860
Merged
Conversation
The web Template type in use-templates.ts was a field-for-field copy of TemplateRecord (apps/server/src/templates/store.ts). Replace the copy with a type-only import so the wire type has a single source of truth, following the jobs consolidation in #856. The Template export is kept so web importers are untouched, and AgentType is already the same shared type on both sides (via shared/agent-types.ts). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 1, 2026
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.
What
Replaces the web
Templatetype inapps/web/src/hooks/use-templates.ts— a field-for-field copy of the server'sTemplateRecord(apps/server/src/templates/store.ts) — with a type-only import and alias (export type Template = TemplateRecord). Net -14 lines, zero behavior change, zero importer changes (theTemplateexport name is preserved).Why it's tech debt
This was one of the mirrored server↔web wire-type pairs identified in the 2026-07-21 audit; drifted copies of these have already produced real bugs (see #844). The jobs pair was consolidated in #856 using the same type-only-import pattern; this is the templates pair.
use-templates.tsalready imports values from../../../server/src/templates/arg-parser, andagentTypeon both sides is the same shared type fromshared/agent-types.ts(#849), so the alias is exact.templates/store.tsis a leaf-ish module (node builtins,pgtypes,db/settings,arg-parser) — web's tsc resolves its imports viaapps/server/node_modules, and esbuild erases type-only imports so nothing reaches the bundle (verified byfinalize:web).Validation
pnpm run checkgreenpnpm run finalize:webgreen (production build)pnpm run test:e2egreen (175 passed, 12 skipped)Queued next
Release wire-type pair (
ReleaseProgress/ReleaseJobinrelease-runtime.tsvsuse-release-stream.ts) — last of the wire-type trio.🤖 Generated with Claude Code