Skip to content

Update platform-server to use Teams gRPC service #1379

@rowan-stein

Description

@rowan-stein

User Request

Remove the filesystem graph entirely from platform-server. Teams service becomes the sole source of truth. No HybridGraphRepository, no FS storage. Remove SlackTrigger, NodeStateService, and GraphPersistController. Migrate variables to Teams RPCs. Add discover-tools endpoint.

Specification (Full FS Graph Removal)

Phase 1: Proto + Client

  1. Regenerate proto — Run buf generate to get latest proto with Variables + McpToolFilter from BSR (feat(teams): add variables and MCP tool filter api#25 merged)
  2. Update TeamsGrpcClient — Add Variable RPC methods: createVariable, getVariable, updateVariable, deleteVariable, listVariables, resolveVariable
  3. Update TeamsGraphSource.mapMcpConfig() — Map tool_filter field to config.toolFilter

Phase 2: GraphRepository Replacement

  1. Rewrite graph.repository.ts — Change abstract class: remove upsert(), upsertNodeState(), initIfNeeded(); replace get(name) with load() returning non-null PersistedGraph
  2. Create teamsGraph.repository.ts — Concrete TeamsGraphRepository extends GraphRepository wrapping TeamsGraphSource.load()PersistedGraph
  3. Rewire graph-domain.module.ts — Replace HybridGraphRepository/FsGraphRepository factory with TeamsGraphRepository; remove unused imports (ConfigService, ModuleRef, TemplateRegistry from factory)

Phase 3: Consumer Updates

  1. liveGraph.manager.ts — Change this.graphs.get('main')this.graphs.load()
  2. memory.service.ts — Change this.graphRepo.get('main')this.graphRepo.load()

Phase 4: Delete FS Graph Infrastructure

  1. Delete files:
    • src/graph/fsGraph.repository.ts
    • src/graph/hybridGraph.repository.ts
    • src/graph/graphSchema.validator.ts
    • src/graph/yaml.util.ts
  2. Update src/graph/index.ts — Remove deleted exports, add TeamsGraphRepository

Phase 5: Remove NodeStateService

  1. Delete src/graph/nodeState.service.ts
  2. Update graph.controller.ts — Remove NodeStateService dependency; remove GET/PUT nodes/:nodeId/state endpoints; add POST nodes/:nodeId/discover-tools endpoint
  3. Update localMcpServer.node.ts — Remove NodeStateService usage; tool discovery = in-memory only (this.toolsCache); add public discoverTools() method; enabledTools filtering uses in-memory state only
  4. Update graph-api.module.ts — Remove NodeStateService from providers/exports

Phase 6: Remove GraphPersistController + Endpoints

  1. Delete src/graph/controllers/graphPersist.controller.ts
  2. Update graph-api.module.ts — Remove from controllers

Phase 7: Migrate GraphVariablesService to Teams RPCs

  1. Rewrite graphVariables.service.ts — Replace GraphRepository dependency with TEAMS_GRPC_CLIENT; use Teams Variables RPCs for CRUD; keep PrismaService for local overrides (VariableLocal); remove name parameter from all methods
  2. Update graphVariables.controller.ts — Remove 'main' args from service calls
  3. Update reference-resolver.service.ts — Remove graphName parameter from resolveValue calls

Phase 8: Remove SlackTrigger

  1. Delete src/nodes/slackTrigger/ directory
  2. Update nodes.module.ts — Remove SlackTrigger from imports/providers/exports
  3. Update templates.ts — Remove SlackTrigger registration

Phase 9: Cleanup

  1. Remove FS graph config from config.service.tsgraphRepoPath, graphLockTimeoutMs
  2. Remove PersistedGraphUpsertRequest/Response from graph.types.ts; remove variables from PersistedGraph
  3. Delete fixtures/tools: __fixtures__/graph-migration/, tools/graph-ref-migrate/
  4. Update graph.utils.ts comment referencing HybridGraphRepository if any

Phase 10: UI Changes

  1. api/modules/graph.ts — Remove saveFullGraph, getFullGraph, putNodeState, getNodeState; add discoverTools(nodeId)
  2. features/graph/services/api.ts — Remove fetchGraph, saveGraph, getNodeState, putNodeState
  3. features/graph/hooks/useGraphData.ts — Remove graph fetching/saving that uses fetchGraph/saveGraph
  4. features/graph/hooks/useNodeTitleMap.ts — Replace fetchGraph() with Teams agents list API
  5. features/secrets/hooks/useSecretsData.ts — Replace getFullGraph() with Teams entity scanning (list agents, tools, mcps from Teams API, scan configs for $secret())
  6. pages/AgentsThreads.tsx — Replace getFullGraph() with Teams agents list for agentOptions
  7. lib/graph/hooks.ts — Remove getNodeState/putNodeState usage; replace with discoverTools for MCP tool state

Phase 11: Test Updates

Delete:

  • __tests__/fsGraph.repository.yaml.test.ts
  • __tests__/graph.fs.persistence.integration.test.ts
  • __tests__/hybridGraph.repository.test.ts
  • __tests__/nodes/slack-trigger.node.spec.ts
  • __tests__/slack.config.schemas.test.ts
  • __tests__/slack.pr.trigger.lifecycle.test.ts
  • __tests__/slack.threading.integration.test.ts
  • __tests__/slack.trigger.events.test.ts

Update test files that mock GraphRepository.get('main')GraphRepository.load():

  • All tests importing/mocking GraphRepository
  • Tests referencing NodeStateService — remove mocks

Keep: __tests__/teamsGraph.source.test.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions