Revert "Merge pull request #1649 from CREDO23/kb_git_mvp" - #1650
Conversation
This reverts commit 366f9c1, keeping the git-native knowledge base in dev until the issues queued for the next release are fixed. Nothing shipped by that merge was reachable in production: git-native behaviour needs both the KNOWLEDGE_STORE_ENABLED env (default FALSE) and a per-workspace column (default false), so reverting changes no runtime behaviour. Migrations 175 and 176 stay applied in production; alembic_version is moved back to 174 by hand so this tree's upgrade is a no-op. Both revisions only add columns, and they use ADD COLUMN IF NOT EXISTS, so re-landing this work re-applies them harmlessly.
|
@CREDO23 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (118)
📝 WalkthroughWalkthroughThe PR removes the Git-native knowledge-store architecture, implementation, configuration, migrations, scheduled jobs, agent middleware, line-span indexing support, documentation, and related tests. Cloud filesystem routing now uses the existing Postgres backend path. ChangesKnowledge-store removal
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Restores the work from #1649, which was reverted on main in #1650 to keep it out of the last release. Content is identical to that merge. This is a revert of the revert (a8292f5) rather than a merge of kb_git_mvp, deliberately. Merging the branch would make its commits an ancestor of both dev and main; main's side deleted those files, so the next merge between the two branches would silently delete them again. A revert carries the content without the history, so dev and main share no ancestor that knows about these files, and the eventual dev -> main merge sees them as added on one side only and keeps them. Git becomes the source of truth for knowledge base content; Postgres and pgvector become a derived, rebuildable index. Both switches guarding the new path default to off: the KNOWLEDGE_STORE_ENABLED env var and the per-workspace knowledge_store_enabled column, so merging this changes no runtime behaviour. Migrations 175 and 176 only add columns and use ADD COLUMN IF NOT EXISTS. They are already applied on production, where alembic_version was moved back to 174 during the revert, so they will re-run harmlessly. Verified on this branch: 0 conflicts against dev, every app.* import in the restored files resolves, 2251 unit tests pass. The one collection error (platforms/google_maps) is missing a fixture that is untracked on both dev and main, and predates this change.
Reverts #1649. The git-native knowledge base goes back to the feature branch until the follow-up items are fixed; the work is preserved on
CREDO23/kb_git_mvp.Why this is safe
Nothing that merge shipped was reachable in production. Git-native behaviour requires two independent switches, and both default to off:
KNOWLEDGE_STORE_ENABLED, an env var that defaults toFALSEworkspaces.knowledge_store_enabled, a per-workspace column that defaults tofalseEvery code path added by #1649 is behind that pair, so with either one off the old write path runs unchanged.
Scope
119 files, all backend, plans, and docs. The frontend is untouched —
surfsense_webhas zero changes in either the merge or this revert, so a Vercel rebuild produces an identical app.The tree after this commit is byte-identical to
366f9c18a^1.Migrations
175 and 176 stay applied on the production database. Both only add columns (
workspaces.knowledge_store_enabled,workspaces.last_indexed_revision,chunks.start_line,chunks.end_line), all nullable or defaulted, and no code in this tree reads them.alembic_versionhas been moved back to174by hand so that this tree'salembic upgrade headis a no-op instead of failing to resolve a revision it no longer contains. Both revisions useADD COLUMN IF NOT EXISTS, so re-landing this work re-applies them harmlessly over the existing columns.Test plan
git diff 366f9c18a^1 <this commit>is empty174alembic upgrade headas a no-op and exits 0High-level PR Summary
This PR reverts PR #1649, which introduced a git-native knowledge base system. The revert removes a feature branch that replaced the custom virtual-filesystem-over-Postgres approach with Git as the single source of truth for workspace knowledge. The feature was unreachable in production (gated behind two independent switches, both defaulting to off:
KNOWLEDGE_STORE_ENABLEDenvironment variable andworkspaces.knowledge_store_enableddatabase column). This revert removes 119 backend files including the completeapp/knowledge_store/module, all associated plans and ADRs, migrations 175 and 176 (which only added nullable columns and will remain applied in production), thedulwichdependency, and extensive test coverage. The work is preserved on theCREDO23/kb_git_mvpfeature branch for future re-landing after follow-up items are addressed. After this revert, the tree is byte-identical to the commit before the original merge.⏱️ Estimated Review Time: 1-3 hours
💡 Review Order Suggestion
docs/adr/0001-git-native-knowledge-base.mddocs/adr/0002-knowledge-core-ports-and-adapters.mdplans/git-native-kb/00-umbrella-plan.mdplans/git-native-kb/00b-diagrams.mdplans/git-native-kb/00c-shared-contract.mdplans/git-native-kb/01-git-storage-core.mdplans/git-native-kb/02-git-working-tree-backend.mdplans/git-native-kb/03-commit-write-path.mdplans/git-native-kb/04-derived-index.mdplans/git-native-kb/05-migration.mdplans/git-native-kb/05a-seed-runbook.mdplans/git-native-kb/06-zero-projection.mdsurfsense_backend/alembic/versions/175_add_workspace_knowledge_store_flag.pysurfsense_backend/alembic/versions/176_add_derived_index_columns.pysurfsense_backend/app/knowledge_store/__init__.pysurfsense_backend/app/knowledge_store/engines/base.pysurfsense_backend/app/knowledge_store/engines/git.pysurfsense_backend/app/knowledge_store/store.pysurfsense_backend/app/knowledge_store/transaction.pysurfsense_backend/app/knowledge_store/write_lock.pysurfsense_backend/app/agents/chat/multi_agent_chat/shared/middleware/filesystem/backends/git_tree.pysurfsense_backend/app/agents/chat/multi_agent_chat/main_agent/middleware/knowledge_store_persistence/commit_turn.pysurfsense_backend/app/knowledge_store/index/converge.pysurfsense_backend/app/knowledge_store/migrate.pysurfsense_backend/app/services/document_revision_recorder.pysurfsense_backend/app/config/__init__.pysurfsense_backend/app/db.pysurfsense_backend/.env.examplesurfsense_backend/pyproject.tomlsurfsense_backend/app/celery_app.pysurfsense_backend/app/routes/documents_routes.pysurfsense_backend/app/routes/editor_routes.pysurfsense_backend/app/indexing_pipeline/indexing_pipeline_service.pysurfsense_backend/app/indexing_pipeline/chunk_reconciler.pysurfsense_backend/app/indexing_pipeline/document_chunker.pysurfsense_backend/app/indexing_pipeline/cache/cached_indexing.pysurfsense_backend/app/observability/metrics.pysurfsense_backend/app/agents/chat/multi_agent_chat/main_agent/middleware/kb_persistence/middleware.pysurfsense_backend/app/agents/chat/multi_agent_chat/main_agent/middleware/stack.pysurfsense_backend/app/agents/chat/multi_agent_chat/shared/middleware/filesystem/backends/resolver.pysurfsense_backend/app/agents/chat/multi_agent_chat/shared/middleware/filesystem/backends/local_folder.pysurfsense_backend/app/agents/chat/multi_agent_chat/shared/middleware/filesystem/backends/multi_root_local_folder.pysurfsense_backend/app/agents/chat/runtime/path_resolver.pysurfsense_backend/app/tasks/celery_tasks/document_reindex_tasks.pysurfsense_backend/app/tasks/chat/streaming/agent/event_loop.pySummary by CodeRabbit
Refactor
Documentation
Chores