Repository: cppa-cursor-browser
Assignee: Brad @bradjin8
Points: 3
Severity: Medium
Problem
API handlers in api/export_api.py and api/workspaces.py import _-prefixed internal functions from service modules (e.g., _get_cli_workspace_tabs from services/cli_tabs.py). The underscore prefix signals "private / not part of the public interface" in Python convention, but the API layer couples to these internals, creating a fragile dependency. These are the same functions where except Exception: pass operates — the silently-failing, privately-coupled, untested interior path identified by the eval. Refactoring the service internals requires updating API handler imports, and the private status provides a false sense of encapsulation.
Acceptance Criteria
Implementation Notes
Audit api/export_api.py and api/workspaces.py for imports of _-prefixed symbols from services/. For each _-prefixed function that is genuinely needed by the API layer, decide: if it's a stable interface, promote it to public (remove the underscore, add a docstring). If it's an implementation detail that shouldn't be exposed, create a public wrapper function that delegates to it. The goal is a clean boundary: api/ imports only public symbols from services/, and services/ can freely refactor its _-prefixed internals. Also check services/workspace_resolver.py and services/cli_tabs.py as sources of _-prefixed exports.
References
- Eval finding: Test 20 (Implementation Hiding) — part of the "Invisible Surface, Untestable Internals" compound (T20+T30+T31)
- Related files:
api/export_api.py, api/workspaces.py, services/cli_tabs.py, services/workspace_resolver.py
Repository: cppa-cursor-browser
Assignee: Brad @bradjin8
Points: 3
Severity: Medium
Problem
API handlers in
api/export_api.pyandapi/workspaces.pyimport_-prefixed internal functions from service modules (e.g.,_get_cli_workspace_tabsfromservices/cli_tabs.py). The underscore prefix signals "private / not part of the public interface" in Python convention, but the API layer couples to these internals, creating a fragile dependency. These are the same functions whereexcept Exception: passoperates — the silently-failing, privately-coupled, untested interior path identified by the eval. Refactoring the service internals requires updating API handler imports, and the private status provides a false sense of encapsulation.Acceptance Criteria
_-prefixed functions imported byapi/modules are either: (a) renamed to public (remove underscore) with proper docstrings, or (b) wrapped by public methods on the service module that delegate to the private implementationapi/file imports any_-prefixed symbol fromservices/Implementation Notes
Audit
api/export_api.pyandapi/workspaces.pyfor imports of_-prefixed symbols fromservices/. For each_-prefixed function that is genuinely needed by the API layer, decide: if it's a stable interface, promote it to public (remove the underscore, add a docstring). If it's an implementation detail that shouldn't be exposed, create a public wrapper function that delegates to it. The goal is a clean boundary:api/imports only public symbols fromservices/, andservices/can freely refactor its_-prefixed internals. Also checkservices/workspace_resolver.pyandservices/cli_tabs.pyas sources of_-prefixed exports.References
api/export_api.py,api/workspaces.py,services/cli_tabs.py,services/workspace_resolver.py