Skip to main content

package ownership

Package Ownership & Decision Tree (for AI Assistants)

Moved from CLAUDE.md to reduce context size. Consult when deciding where to put code.

ALL shared code MUST be in the appropriate @bluefly/* packages. NO EXCEPTIONS.

See architecture/separation-of-duties.md for the complete ownership matrix.

Key Package Ownership Rules

PackageOwnsFORBIDDEN
@bluefly/agent-brainVector search, semantic search, Qdrant, embeddings, RAG, codebase indexing, memoriesCreating vector/search services in other projects
@bluefly/agent-dockerDocker operations, Kubernetes operations, container management, deployment orchestrationCreating docker/kubernetes services in agent-buildkit
@bluefly/agent-meshAgent-to-agent communication, service mesh, coordination, discovery, transport, authCreating mesh/coordination services in agent-buildkit
@bluefly/agent-protocolMCP servers, MCP registry, protocol adapters, MCP integrationCreating MCP/protocol services in agent-buildkit
@bluefly/agent-routerAgent routing, cost-aware routing, task routing, agent discovery, Vast.ai scalingCreating router services in agent-buildkit
@bluefly/agent-tailscaleALL Tailscale operations (subnet, DNS, SSH, certificates, webhooks, monitoring)Creating ANY Tailscale services in agent-buildkit
@bluefly/agent-tracerDistributed tracing, OpenTelemetry, RPC tracing, trace analysis, observabilityCreating tracing services in agent-buildkit
@bluefly/agentic-flowsAgent orchestration, multi-agent workflows, service registry, ecosystem orchestrationCreating orchestration services in agent-buildkit
@bluefly/compliance-engineAudit services, compliance checks, policy validation, separation of duties validationCreating audit/compliance services in agent-buildkit (48 files found - MIGRATE!)
@bluefly/foundation-bridgeLLM providers, model orchestration, provider routing, enterprise LLM servicesCreating LLM provider services in agent-buildkit
@bluefly/workflow-engineWorkflow execution, state management, step runners, error handling, workflow typesCreating workflow services in agent-buildkit (8 files found - MIGRATE!)
@bluefly/studio-uiALL React UI components, shared UI components, reusable UI patternsCreating React UI components in other projects

Decision Tree: Where to Build What

START: What are you building?
│
├─→ Service/Business Logic?
│   └─→ Which domain?
│       ├─→ Routing/Discovery → @bluefly/agent-router
│       ├─→ Agent Communication → @bluefly/agent-mesh
│       ├─→ Vector/Search/RAG → @bluefly/agent-brain
│       ├─→ Tracing/Observability → @bluefly/agent-tracer
│       ├─→ Docker/K8s → @bluefly/agent-docker
│       ├─→ Tailscale/Network → @bluefly/agent-tailscale
│       ├─→ Workflows/State → @bluefly/workflow-engine
│       ├─→ MCP/Protocol → @bluefly/agent-protocol
│       ├─→ LLM Providers → @bluefly/foundation-bridge
│       ├─→ Compliance/Audit → @bluefly/compliance-engine
│       └─→ Orchestration → @bluefly/agentic-flows
│
├─→ CLI Command or Script?
│   ├─→ Reusable/DRY code? → agent-buildkit (enhance existing commands)
│   ├─→ One-off script? → tmp/ directory (temporary)
│   └─→ agent-buildkit imports from `@bluefly/*` packages (never duplicate)
│
├─→ Agent registry / .agents/ validation / workspace discovery?
│   └─→ agent-buildkit (commands) + gitlab_components (CI templates)
│
├─→ IDE integration?
│   └─→ ide-supercharger (PULLS from agent-buildkit; does NOT duplicate)
│
├─→ Agent Definition (OSSA manifest)?
│   └─→ platform-agents/packages/@ossa/
│
├─→ React UI Component? → @bluefly/studio-ui
├─→ CI/CD Pipeline? → gitlab_components
├─→ API Schema? → api-schema-registry
├─→ Security Policy? → security-policies
├─→ Documentation? → technical-docs (GitLab Wiki)
├─→ Drupal Module/Theme/Recipe? → Individual git repos
└─→ Model Definition? → models/

Agent Role Separation

Agents must follow OSSA access tier definitions and role conflict rules. See architecture/separation-of-duties.md.

Access Tiers (OSSA v0.3.3)

TierRoleCanCannot
tier_1_readAnalyzerQuery APIs, scan code, reportsCreate/modify resources, push, approve
tier_2_write_limitedReviewer/OrchestratorMR comments, create issues, coordinatePush code, merge MRs, modify production
tier_3_full_accessExecutorPush code, create MRs, deploy to stagingMerge without review, deploy to prod, approve own
tier_4_policyApproverApprove MRs, authorize productionPush code, execute deployments, review own

Role Conflict Matrix

RoleConflicts WithReason
AnalyzerExecutor, ApproverCannot fix what you audit
ReviewerExecutor, ApproverCannot approve own changes
ExecutorReviewer, ApproverCannot review/approve own work
OrchestratorExecutor (direct)Coordinator cannot directly execute
ApproverExecutor, ReviewerCannot approve if involved in creation

Automated Enforcement

Pre-commit Hooks

npx @bluefly/compliance-engine check-imports --fail-on-violation npx @bluefly/compliance-engine check-file-location --fail-on-violation npx @bluefly/compliance-engine check-duplication --fail-on-violation

CI Pipeline Gate

All projects MUST include separation-of-duties-check component from gitlab_components.

Import Validation Rules

// Valid: import { VectorSearchService } from '@bluefly/agent-brain'; import { QdrantClient } from '@bluefly/agent-brain/qdrant'; // VIOLATIONS: import { internalHelper } from '@bluefly/agent-brain/src/internal/helpers'; import { something } from '../../agent-brain/src/services';