-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
tech-debtTechnical debt reductionTechnical debt reduction
Description
Summary
6 global let variables for API keys, a global pipelineState object, walkthroughStep, pendingCommitData, and 30+ window.* function exports create a web of implicit coupling where any function can read/write any state at any time.
Risk Assessment
- Risk Level: Medium
- Likelihood: High
- Impact: Medium — debugging difficulty, race conditions between pipeline and refinement
Affected State
| Variable | Line | Risk |
|---|---|---|
geminiApiKey, anthropicApiKey, openaiApiKey, openRouterApiKey, flutterflowApiKey, flutterflowProjectId |
463-468 | Any function can overwrite silently |
pipelineState |
969 | Race conditions between pipeline and refinement |
walkthroughStep |
506 | Minor |
pendingCommitData |
4297 | Shared between async flows |
30+ window.* exports |
4551-4593 | Everything globally callable, including from devtools |
Suggested Fix
- Encapsulate API key state in a module with getter/setter pattern
- Make
pipelineStatea class with controlled mutations - Use
Object.freeze()for read-only config - Replace
window.*exports with event delegation or ES module imports
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
tech-debtTechnical debt reductionTechnical debt reduction