Severity: Medium
Three related type-safety problems in sisyphus-api.
1. WorkflowType = string
sisyphus-api/src/runner/types.ts:3:
export type WorkflowType = string;
This is a no-op alias — every string accepted. Compounded by pathMatch[1] as WorkflowType (runner/ws-server.ts:25) which casts an arbitrary URL segment to "valid type" before validation.
2. The actual type list is hardcoded in three places
sisyphus-api/src/runner/session-manager.ts:158 — if (!["research", "translate", "purify", "verify"].includes(workflowType)).
sisyphus-api/src/runner/ws-server.ts:26 — same list, again.
- Implicit knowledge in controllers (path validation depends on this).
3. Dead / unreachable exports
sisyphus-api/src/runner/aevatar-client.ts:96 — fetchWorkflowDeploymentStatus is exported and re-imported in session-manager.ts:11 but never called.
sisyphus-api/src/papers/storage-client.ts:36 — getPresignedUrl exported, no caller.
sisyphus-api/src/papers/models/compile-history.ts — entire module (CompileRecord, getCompileCollection, ensureCompileIndexes) is wired into index.ts:7 but never read or written by any controller.
sisyphus-api/src/workflows/mainnet-client.ts:46 — uploadRoles is exported, imported in CompileController.ts:23, but never invoked (a comment at :276-278 confirms intentional skip — but then why import it?).
Remediation
// runner/types.ts
export const WORKFLOW_TYPES = ["research", "translate", "purify", "verify"] as const;
export type WorkflowType = typeof WORKFLOW_TYPES[number];
export function isWorkflowType(s: string): s is WorkflowType {
return (WORKFLOW_TYPES as readonly string[]).includes(s);
}
Then:
session-manager.ts:158 and ws-server.ts:26 import WORKFLOW_TYPES from runner/types.ts.
ws-server.ts:25 uses isWorkflowType(pathMatch[1]) instead of the unsafe cast.
Delete the dead exports (or wire compile-history if its persistence was intended — see #5 follow-up).
Severity: Medium
Three related type-safety problems in
sisyphus-api.1.
WorkflowType = stringsisyphus-api/src/runner/types.ts:3:This is a no-op alias — every string accepted. Compounded by
pathMatch[1] as WorkflowType(runner/ws-server.ts:25) which casts an arbitrary URL segment to "valid type" before validation.2. The actual type list is hardcoded in three places
sisyphus-api/src/runner/session-manager.ts:158—if (!["research", "translate", "purify", "verify"].includes(workflowType)).sisyphus-api/src/runner/ws-server.ts:26— same list, again.3. Dead / unreachable exports
sisyphus-api/src/runner/aevatar-client.ts:96—fetchWorkflowDeploymentStatusis exported and re-imported insession-manager.ts:11but never called.sisyphus-api/src/papers/storage-client.ts:36—getPresignedUrlexported, no caller.sisyphus-api/src/papers/models/compile-history.ts— entire module (CompileRecord,getCompileCollection,ensureCompileIndexes) is wired intoindex.ts:7but never read or written by any controller.sisyphus-api/src/workflows/mainnet-client.ts:46—uploadRolesis exported, imported inCompileController.ts:23, but never invoked (a comment at:276-278confirms intentional skip — but then why import it?).Remediation
Then:
session-manager.ts:158andws-server.ts:26importWORKFLOW_TYPESfromrunner/types.ts.ws-server.ts:25usesisWorkflowType(pathMatch[1])instead of the unsafe cast.Delete the dead exports (or wire
compile-historyif its persistence was intended — see #5 follow-up).