refactor(decopilot): remove dead control-frame wire codec - #6164
Open
pedrofrxncx wants to merge 1 commit into
Open
refactor(decopilot): remove dead control-frame wire codec#6164pedrofrxncx wants to merge 1 commit into
pedrofrxncx wants to merge 1 commit into
Conversation
encodeControlFrame/decodeControlFrame have zero callers left — the CancelBroadcast.publishControlFrame path they were built for is a documented no-op (the durable cancel_requested_at flag is the real correctness path; see cancel-broadcast.ts), and nothing else in the repo calls the codec functions. The ControlFrame type/schema itself is still live (used by the CancelBroadcast interface and its NATS implementation), so only the unused encode/decode pair and their now-orphaned test go.
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.
Source: dead-code sweep (C1) of
apps/api/src/api/routes/decopilot/— the area other PRs this tick weren't touching.What:
encodeControlFrame/decodeControlFrameincontrol-frames.tshave zero callers anywhere in the repo outside their own test file.rg -n "encodeControlFrame|decodeControlFrame"across the whole tree turns up only the definitions andcontrol-frames.test.ts. TheCancelBroadcast.publishControlFramepath these were built to serialize for is a documented no-op inNatsCancelBroadcast(publishControlFrame(_userSub, _frame) {}) and in the app-wiring stub inapp.ts— the comment on the interface says the durablecancel_requested_atflag is the real correctness path, so the wire codec was never wired up to anything live.The
ControlFrametype/schema stays: it's still the real contract type for theCancelBroadcast.publishControlFrame(userSub, frame: ControlFrame)interface method used innats-cancel-broadcast.ts,cancel-broadcast.ts,routes.ts, andapp.ts. Only the unused JSON encode/decode functions and their now-orphaned test go.Payoff: removes vestigial code from the old tunnel-based control-frame delivery so a future reader doesn't waste time tracing a codec that's never called.
Net: -39 lines / +0.
Verified:
rgconfirms zero callers of either function outside the deleted test.bun run fmt— clean.cd apps/api && bunx tsc --noEmit— clean (no type errors from the removal).bunx oxlint apps/api/src/api/routes/decopilot/control-frames.ts— 0 warnings/errors.A reviewer can confirm with:
rg -n "encodeControlFrame|decodeControlFrame" apps packages(only doc/PR-body hits expected).Summary by cubic
Removes the unused JSON codec for Decopilot control frames to reduce dead code. The codec had no callers;
CancelBroadcast.publishControlFrameis a no-op, and theControlFrametype/schema remains.Review notes
control-frames.test.tsand removesencodeControlFrame/decodeControlFramefromcontrol-frames.ts; keeps theControlFrameschema/type.cancel_requested_atflag.rg -n "encodeControlFrame|decodeControlFrame"shows no callers; typecheck and lint pass.Written for commit 3d3d843. Summary will update on new commits.