chore(platform): remove rg-proven dead code from the 0.5 backend - #3200
Merged
Conversation
larryro
force-pushed
the
chore/dead-code-cleanup
branch
from
September 4, 2026 01:58
ba2f606 to
44a2678
Compare
larryro
marked this pull request as ready for review
September 4, 2026 02:41
ensure_hex_instance_secret had no caller anywhere in the repo (rg: only its definition); docker-entrypoint.sh wires ensure_instance_secret alone. Its comment described the Convex generate-admin-key tooling that no longer exists.
REVIEW_POLICY_REFUSAL_CODES is the only export of core/tasks/review_shared.ts with an importer (domains/tasks/service.ts). Every other export had zero importers; their pg twins live in domains/tasks/reviews.ts. core/collab/notify_task_reviews.ts was imported by review_shared.ts alone (twins in domains/collab/service.ts), so it goes with it.
core/automations/store.ts had one importer: the provisioning seed test, which only pulled assertAutomationName. The live store is domains/automations/store.ts (same export, a superset name rule), so the test now checks the shipped packs against the store that actually runs.
generateBlobUpload, generateReplacementBlobUpload, ReplacementBlobUploadHandoff and CONVEX_UPLOAD_TTL_MS had zero callers: the 0.5 upload wire is served by domains/files/routes.ts (/blob-upload) and the replacement lane by domains/documents/replacement.ts, both presigning directly. putImmutableS3Blob stays (live at replacement.ts).
Each of these had exactly one importer, a file removed in the previous commits, and a live pg twin: dismiss_review_notifications and actor_name (domains/collab/service.ts), core/governance/competence (domains/governance/competence.ts), core/governance/review_policy (lib/org-config.ts), core/audit_logs/agent_run_ledger (domains/tasks/run-ledger.ts). resolveActorAndSubject had no caller at all.
larryro
force-pushed
the
chore/dead-code-cleanup
branch
from
September 4, 2026 05:39
44a2678 to
a01779d
Compare
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.
Dead-code cleanup, every removal rg-proven (zero callers) and tsc-proven (nothing referenced it). Stays out of the Convex-retirement residue (#3125:
init-scripts/02-create-convex-database.sql, compose comments, thetale_platformvolume, the remaining env.sh comments) and out of theresolveUserEnvForInjection/ feature-flag plumbing (product decision pending).Why knip never flagged any of this:
backend/**/*.tsare knip entries forservices/platform, so unused exports of backend files are not reported.Per-target outcome
services/platform/env.sh— removedensure_hex_instance_secretand its Convexgenerate-admin-keycomment. rg: only its definition;ensure_instance_secretis the one wired (docker-entrypoint.sh:222).bash -nclean.core/tasks/review_shared.ts— trimmed toREVIEW_POLICY_REFUSAL_CODES(sole importerdomains/tasks/service.ts:17, still there). Every other export (approvalRound,approvalRunId,resolveReviewer,TaskReviewTrigger,requestTaskReview,TaskReviewResponse,isReviewPolicyRefusal,checkReviewPolicyForResponder,collectTaskWatcherIds,TaskReviewLeaveActor,closePendingTaskReviewOnStatusLeave) had zero importers; the live gate isdomains/tasks/reviews.ts.core/collab/notify_task_reviews.ts— removed: its only importer wasreview_shared.ts;notifyTaskReviewRequested/notifyTaskReviewResolved/TaskReviewSubmitterlive indomains/collab/service.ts,notifyTaskReviewerAssignedhad no caller anywhere.core/automations/store.ts— removed. One importer in the tree:core/provisioning/provision_default_automations.test.ts, pullingassertAutomationName. Repointed todomains/automations/store.ts(the store that runs; same export, a superset name rule) — the test's assertion "a name the store would refuse must never ship" now checks the real store. 2/2 green.signUpOrgMemberconvergence — not done. The shared helper does not exist onmain; it is introduced by draft PR test(platform): make a truncated itest run fail loudly #3198 (fix/itest-harness-integrity), which also rewrites several of the 21 rawsign-up/emailsites. Forking the helper here would conflict with that PR — converge after test(platform): make a truncated itest run fail loudly #3198 lands.format:checkvs the edit hook — no change; the premise does not hold. oxfmt honors.oxfmtrc.jsonignorePatterns(**/*.md,**/*.yml) for explicitly passed paths too:bunx oxfmt -c .oxfmtrc.json docs/en/cloud/onboarding.md→ "All matched files may have been excluded by ignore rules", and running the hook itself in write mode on a known-unformatted page (docs/fr/develop/rate-limits.md) changed nothing. Hook and CI agree today (both skip markdown). For the record: with**/*.mdun-ignored,oxfmt --list-differentnames 13 of 439 docs pages and 16 other.mdfiles (AGENTS/skills/design docs) — enabling markdown formatting is a separate reformat decision, not a dead-code PR.deleteKnowledgeDocumentsBatch— kept, live (domains/knowledge/release.ts:172).generateReplacementBlobUpload+ReplacementBlobUploadHandoff+CONVEX_UPLOAD_TTL_MS— removed (zero consumers; the live replacement lanedomains/documents/replacement.tspresigns directly;putImmutableS3Blobkept, live atreplacement.ts:562).generateBlobUpload— removed too (zero callers; the frontend'sfiles/blob_actions:generateBlobUploadis the wire's action name, served bydomains/files/routes.ts/blob-upload, not this function). Unused importsDEFAULT_PRESIGN_TTL_SEC/s3PresignPutUrlpruned with them.One-hop orphans removed (each had exactly one importer — a file removed above — and a live pg twin):
core/collab/dismiss_review_notifications.ts,core/notifications/actor_name.ts(incl. the never-calledresolveActorAndSubject),core/governance/competence.ts,core/governance/review_policy.ts,core/audit_logs/agent_run_ledger.ts(twindomains/tasks/run-ledger.ts).Left alone / follow-ups:
core/betterAuth/trusted_headers/get_user_by_id.tsis now import-free (second hop — its only importer wasactor_name.ts); prose mentions of the 0.4automationActionStoreindispatch-store.ts:40/run_session.ts:9; theconvex/collab/notify_task_reviews.tspath inlib/i18n/keys-dynamic.yml:99(Convex residue → #3125).Gates run and observed
bash -n services/platform/env.sh— OKservices/platform:bunx tsc --noEmit— exit 0 (50 s)services/platform:bunx oxlint --type-aware— exit 0serverproject) touched suites — 7 files, 67 tests passed (provision_default_automations,bound_run_payload,session_exec,collab/service,automations/store.*,governance/helpers)bunx oxfmt --check— 4470 files, all formattedbunx knip— exit 0 (one pre-existing hint:cron-parserinignoreDependencies)backend:integration— not run: the harness is untouched (target 4 not done) and every removed symbol had zero callers, which the typecheck proves.