Skip to content

Conversation

@josephgoksu
Copy link
Owner

Summary

  • Workspace-aware knowledge scoping for monorepo support: knowledge nodes can now be tagged with a workspace (e.g., api, web, root) and filtered during recall
  • New tw workspaces command to list detected workspaces in a project
  • --workspace and --all flags for tw list and tw context commands
  • MCP recall tool now accepts workspace and all parameters
  • Workspace badges in tw list output showing [workspace] for non-root nodes
  • Auto-detection of current workspace from working directory
  • Database migration adds workspace column to nodes table with index

Key Changes

Database & Models

  • Added workspace column to nodes table with index for efficient filtering
  • Node model includes Workspace field (defaults to empty, treated as root)
  • NodeFilter struct with Workspace and IncludeRoot fields

Repository Layer

  • ListNodesFiltered(), ListNodesWithEmbeddingsFiltered(), SearchFTSFiltered() methods
  • Workspace filtering in SQL queries with index usage

Knowledge Service

  • SearchWithFilter() for workspace-scoped search
  • matchesWorkspaceFilter() helper for post-search filtering

CLI Commands

  • tw workspaces - List detected workspaces with optional --counts
  • tw list --workspace=<name> - Filter by workspace (includes root by default)
  • tw context --workspace=<name> - Search within workspace scope
  • --all flag to explicitly search all workspaces

MCP Integration

  • recall tool accepts workspace and all parameters
  • Workspace-scoped results include root knowledge when IncludeRoot=true

Bootstrap

  • Agents accept workspace parameter and tag findings consistently
  • Auto-detect workspace from current working directory

Test plan

  • Unit tests for repository workspace filtering (internal/memory/migration_test.go)
  • Unit tests for knowledge service workspace scoping (internal/knowledge/debug_test.go)
  • Integration tests for monorepo end-to-end (tests/integration/workspace_test.go)
  • go test ./... passes
  • make test (unit + integration + MCP) passes
  • Manual testing of tw workspaces, tw list --workspace, tw context --workspace

Documentation

  • Updated BOOTSTRAP_INTERNALS.md with workspace support section
  • Updated MCP_INTEGRATION.md with recall tool parameters and examples
  • Updated CHANGELOG.md with feature notes

🤖 Generated with Claude Code

josephgoksu and others added 27 commits January 21, 2026 17:16
Add workspace filtering support for monorepo-aware knowledge queries:

- cmd/list.go: Add --workspace (-w) and --all flags
  - --workspace filters by workspace name, includes root by default
  - --all explicitly shows all workspaces (ignores auto-detection)
  - Uses ListNodesFiltered when workspace is specified

- cmd/context.go: Add --workspace (-w) and --all flags
  - Passes workspace to RecallOptions for SearchWithFilter
  - Updated help text with workspace filtering documentation

Help text includes back-compat note: nodes without workspace
are treated as 'root' (global knowledge).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Workspace and All parameters to ProjectContextParams
- Update handleNodeContext to use workspace filtering
- Validates workspace name and includes root by default

This completes workspace-aware recall for both CLI and MCP.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add cmd/workspaces.go: new command to list detected workspaces
  - Shows workspace type (single/monorepo/multi-repo)
  - Shows current workspace based on cwd
  - Optional --counts flag for node counts per workspace
  - JSON output support

- Update internal/ui/list_view.go: add workspace display
  - Compact mode: workspace badge [name] for non-root nodes
  - Verbose mode: dedicated Workspace column in table

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add TestMonorepoWorkspace_EndToEnd integration test that validates:
  - Workspace detection in monorepo structures
  - Knowledge nodes created with correct workspace tags
  - ListNodesFiltered returns workspace-scoped results
  - SearchFTSFiltered respects workspace filters
  - IncludeRoot flag includes root nodes when filtering

- Add TestWorkspaceDetectionFromCwd for cwd-based detection
- Add scripts/test_mcp_workspace.sh for manual MCP testing
- Apply go fmt formatting to modified files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Document new tw workspaces command
- Document --workspace and --all flags for list/context
- Document MCP recall workspace parameter
- Document backward-compatible migration behavior
- Note database schema change (workspace column)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Workspace Support section to BOOTSTRAP_INTERNALS.md
  - Document workspace detection (single/monorepo/multi-repo)
  - Document workspace tagging behavior
  - Add MCP integration examples with workspace params
  - Reference local dev MCP testing workflow

- Update MCP_INTEGRATION.md
  - Add all MCP tools to Available Tools table
  - Document recall tool parameters (query, answer, workspace, all)
  - Add workspace-scoped search examples
  - Add Development & Testing section for local dev MCP

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The release notes were empty because changelog was disabled. Now using
GitHub-native changelog with conventional commit grouping:
- 🚀 Features (feat:)
- 🐛 Bug Fixes (fix:)
- 📚 Documentation (docs:)
- 🧪 Tests (test:)
- 🔧 Maintenance (chore, refactor, etc.)

Also updated header to include full changelog comparison link.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@josephgoksu josephgoksu merged commit e242374 into main Jan 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants