Clean up remaining unused helpers and low-signal tests#139
Clean up remaining unused helpers and low-signal tests#139MirzaMerdovic merged 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
QA Review — issues/orfe-138
Decision: CHANGES REQUIRED
PR body first line Ref: #138 ✓
Branch issues/orfe-138 → main ✓
Blockers
1. CommandExecutionRequirements not removed or justified (src/commands/registry/types.ts line 18–22)
The interface is exported but has zero usages outside its own file (grep confirms: only one match, its own declaration). The issue explicitly named this as in-scope:
remove or justify
src/commands/registry/types.tsCommandExecutionRequirements
The acceptance criterion is:
obviously unused helpers/types are removed or explicitly retained with a clear reason
Neither happened. The interface is still exported with no justification comment and no PR note explaining why it was retained.
Required action: remove the interface, or add an explicit justification (e.g., a comment explaining its intended future use or whether it is part of a public extension surface).
2. createNotImplementedError() not removed or justified (src/errors.ts line 70–72)
Same situation. Exported, zero callers outside its own file (grep: one match, the declaration). Explicitly named in issue scope:
remove or justify
src/errors.tscreateNotImplementedError()
Required action: remove the function, or add an explicit justification and comment. The not_implemented error code can still survive on ERROR_CODES if needed — the question is just the dead helper wrapper.
What Passed
-
createRuntimeSnapshot()/RuntimeSnapshot— ✅ Removed entirely fromsrc/core.ts. The two tests (createRuntimeSnapshot validates machine-local auth mapping,createRuntimeSnapshot proves auth config is separate from repo-local config) were removed fromtest/core.test.ts. The behavior they covered (config loading, auth validation, caller resolution) is still meaningfully exercised throughrunOrfeCoretests. Criterion satisfied. -
test/logging.test.tsrepoparameter — ✅ Fixed correctly. Therepoparameter is now used in thehtml_urltemplate literal (https://github.com/${repo.fullName}/issues/113) rather than a hardcoded string. Since the parameter exists to satisfy the parent class override signature, making it used is the right fix. Criterion satisfied. -
Low-signal registry tests — ✅ Meaningfully improved. The old tests included:
- A hardcoded group list assertion that would silently pass even if groups changed
- Trivial
.includes()existence checks for specific command names
The new tests derive expected values from the live
COMMANDSarray (the group deduplication assertion), and add a real behavioral test (registry rejects unknown commands) that exercises the error path. The combined assertions are meaningfully stronger than what was removed. Criterion satisfied. -
GitHubClientFactoryDependenciesandGitHubInstallationAuthinsrc/github.ts— ✅ Unexported (changed fromexport interfacetointerface). Both remain used internally. Good reduction of public dead surface, even though these were not explicitly named in the issue scope. -
Indentation fix in
src/core.tslines 128–132 — minor formatting cleanup on thecachedGitHubAuthblock; no behavioral change. -
MachineAuthConfigimport removed fromsrc/core.ts— ✅ Correct; no longer needed aftercreateRuntimeSnapshotremoval. -
Tautological
listCommandNames exposes the agreed V1 command surfacetest removed fromtest/core.test.ts— ✅ Correct; the equivalent assertion is already insrc/commands/registry/index.test.tsand compares againstCOMMANDS.map(...)rather than a pre-derived constant, so no coverage is lost.
Nice to Have (not blocking)
- The
registry derives unique command groups and keeps top-level commands out of themtest now ties the assertion directly to the liveCOMMANDSarray, which is great. One optional follow-on: a small inline comment explaining why thetopLevelfilter exists (to distinguishhelpfrom grouped commands) would help future readers unfamiliar with thetopLevelflag convention.
What I Verified
- Read the full diff across all 5 changed files
- Grep-confirmed
CommandExecutionRequirementshas exactly 1 match (its own declaration) — no consumers - Grep-confirmed
createNotImplementedErrorhas exactly 1 match (its own declaration) — no consumers - Grep-confirmed
GitHubClientFactoryDependenciesandGitHubInstallationAuthare used only withinsrc/github.ts— de-exporting is safe - Confirmed the
repoparameter inlogging.test.tsEmittingGitHubClientFactory.createClientoverride is the right level to fix (parent signature includes it; using it inhtml_urlis correct) - Reviewed registry test changes against the original; confirmed no meaningful behavior regression
There was a problem hiding this comment.
QA Re-Review — Round 2 (commit c5df8b8)
Decision: APPROVED
Both blockers from round 1 are resolved. No new issues found.
Blockers Resolved
1. CommandExecutionRequirements removed (src/commands/registry/types.ts)
The interface is gone. Grep confirms zero remaining references anywhere in the repository. The file shrinks cleanly from 97 to 91 lines with no other disruption.
2. createNotImplementedError() removed (src/errors.ts)
The function and its associated import type { OrfeCommandName } (which was only needed for that function) are both gone. Grep confirms zero remaining references. The not_implemented error code is correctly retained on ERROR_CODES (line 18) since it is still used by OrfeError itself — that is the right call.
Full Branch State Confirmed Clean
All 7 files in the branch diff (src/commands/registry/index.test.ts, src/commands/registry/types.ts, src/core.ts, src/errors.ts, src/github.ts, test/core.test.ts, test/logging.test.ts) — net –113 lines vs main. Every acceptance criterion is satisfied:
- ✅ Unused helpers/types removed:
CommandExecutionRequirements,createNotImplementedError,RuntimeSnapshot,createRuntimeSnapshot,MachineAuthConfigimport,GitHubClientFactoryDependencies/GitHubInstallationAuthunexported - ✅
createRuntimeSnapshot()removed — no longer dead test-only production surface - ✅
test/logging.test.tsrepoparameter now used (not unused) - ✅ Registry tests meaningfully strengthened (COMMANDS-derived assertions + real error-path test)
- ✅ Greg's reported verification (test / lint / typecheck / build) consistent with the clean code state
Ref: #138
Summary
Testing