SurfSense/surfsense_backend/tests/unit
CREDO23 1acde6a470 test(agents): cover live filesystem middleware, retire dead twin
The single-agent-era filesystem middleware (app/agents/shared/middleware/
filesystem.py, ~2000 lines) was never instantiated in production, yet three
unit suites validated it — an illusory guardrail while the live decomposed
middleware (multi_agent_chat/middleware/shared/filesystem) was unguarded.

Close the gap before reorganizing the agents module:
- Add 14 integration tests driving live B's tools in desktop mode (real
  on-disk effects) and cloud mode (in-state staging, namespace policy).
- Port all high-value dead-twin assertions onto the live path: cloud rm/rmdir
  staging + guard rails, KBPostgresBackend delete-view filter, mode-scoped
  system prompt, cwd/relative/namespace resolution, multi-root mount
  normalization.
- Delete dead twin filesystem.py, drop its __init__ re-export, and retire its
  3 dead-twin tests.

Verified: test_import_all + middleware unit + FS integration all green.
2026-06-04 17:46:49 +02:00
..
adapters test: bootstrap pytest environment for backend 2026-02-24 18:19:56 +02:00
agents test(agents): cover live filesystem middleware, retire dead twin 2026-06-04 17:46:49 +02:00
automations refactor(agents): move llm_config + prompt_caching to app/agents/shared (slice 4b) 2026-06-04 12:41:52 +02:00
connector_indexers refactor(jira): remove dead legacy indexing and write tools (mcp-only now) 2026-06-02 16:38:00 +02:00
connectors chore: ran linting 2026-04-07 05:55:39 +05:30
db feat: improved agent streaming 2026-04-29 07:20:31 -07:00
e2e_fakes test(backend): enhance Drive file filtering and add unit tests for _drive_list_files 2026-05-06 17:58:58 +05:30
etl_pipeline chore: linting 2026-05-15 17:33:44 -07:00
event_bus refactor: anonymous/free chat experience 2026-05-31 15:58:21 -07:00
gateway fix: repair pre-existing agent_task, gateway, and skills tests 2026-06-04 10:25:06 +02:00
google_unification chore: ran linting 2026-05-09 05:28:09 +05:30
indexing_pipeline Merge remote-tracking branch 'upstream/dev' into fix/backend-tests 2026-05-16 19:40:01 +05:30
middleware test(agents): cover live filesystem middleware, retire dead twin 2026-06-04 17:46:49 +02:00
notifications test: add notifications unit tests and conventions doc 2026-06-03 21:53:06 +02:00
observability feat(env): add SURFSENSE_ENV variable for deployment environment and update observability resource attributes 2026-05-23 02:13:24 +05:30
routes refactor(agents): move feature flags to app/agents/shared/feature_flags (slice 2b) 2026-06-04 12:23:12 +02:00
services refactor(agents): move tools package to app/agents/shared (slice 6) 2026-06-04 13:11:56 +02:00
tasks refactor(chat): delete legacy stream_new_chat monolith (cutover complete) 2026-06-04 14:35:45 +02:00
utils test(backend): add OAuth state security unit tests 2026-05-06 17:18:31 +05:30
__init__.py test: bootstrap pytest environment for backend 2026-02-24 18:19:56 +02:00
test_error_contract.py chore: linting 2026-04-22 01:05:31 -07:00
test_obsidian_plugin_indexer.py chore: linting 2026-04-27 14:04:50 -07:00