agentic-flow 1.9.0 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/analysis/code-analyzer.md +1 -1
- package/.claude/agents/core/coder.md +2 -57
- package/.claude/agents/core/planner.md +1 -53
- package/.claude/agents/core/researcher.md +6 -60
- package/.claude/agents/core/reviewer.md +1 -55
- package/.claude/agents/core/tester.md +1 -54
- package/.claude/agents/goal/goal-planner.md +25 -120
- package/.claude/agents/swarm/hierarchical-coordinator.md +4 -75
- package/.claude/agents/templates/coordinator-swarm-init.md +4 -19
- package/.claude/commands/hooks/overview.md +10 -84
- package/.claude/settings.json +20 -21
- package/.claude/settings.local.json +7 -3
- package/CHANGELOG.md +976 -83
- package/README.md +1 -15
- package/dist/agentdb/tests/frontier-features.test.js +665 -0
- package/{agentic-flow/dist → dist}/cli/config-wizard.js +13 -4
- package/dist/cli/federation-cli.d.ts +53 -0
- package/{agentic-flow/dist → dist}/cli-proxy.js +22 -15
- package/dist/hooks/parallel-validation.js +166 -0
- package/dist/hooks/swarm-learning-optimizer.js +350 -0
- package/{agentic-flow/dist → dist}/proxy/provider-instructions.js +98 -0
- package/dist/reasoningbank/config/reasoningbank-types.ts +57 -0
- package/{agentic-flow/dist → dist}/utils/cli.js +29 -0
- package/docs/.claude-flow/metrics/performance.json +3 -3
- package/docs/.claude-flow/metrics/task-metrics.json +3 -3
- package/docs/guides/MCP-TOOLS.md +850 -1050
- package/package.json +169 -44
- package/validation/docker/Dockerfile.reasoningbank-local +24 -0
- package/validation/docker/Dockerfile.reasoningbank-test +21 -0
- package/validation/docker/README.md +234 -0
- package/validation/docker/docker-compose.yml +29 -0
- package/validation/docker/test-reasoningbank-npx.mjs +442 -0
- package/validation/docker-e2e-validation.sh +212 -0
- package/validation/docker-quic-test.sh +42 -0
- package/validation/docker-quic-validation.sh +60 -0
- package/validation/quic-deep-validation.ts +304 -0
- package/validation/test-quic-integration.ts +243 -0
- package/validation/test-quic-wasm.ts +94 -0
- package/validation/test-regression.mjs +246 -0
- package/validation/test-wasm-e2e.ts +354 -0
- package/validation/test-wasm-integration.ts +99 -0
- package/wasm/quic/agentic_flow_quic.d.ts +37 -0
- package/wasm/quic/agentic_flow_quic_bg.wasm.d.ts +19 -0
- package/wasm/reasoningbank/reasoningbank_wasm.d.ts +41 -0
- package/wasm/reasoningbank/reasoningbank_wasm_bg.wasm.d.ts +20 -0
- package/.claude/agents/goal/code-goal-planner.md +0 -446
- package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +0 -130
- package/.claude/agents/hive-mind/queen-coordinator.md +0 -203
- package/.claude/agents/hive-mind/scout-explorer.md +0 -242
- package/.claude/agents/hive-mind/swarm-memory-manager.md +0 -193
- package/.claude/agents/hive-mind/worker-specialist.md +0 -217
- package/.claude/agents/neural/safla-neural.md +0 -74
- package/.claude/agents/reasoning/README.md +0 -452
- package/.claude/agents/reasoning/adaptive-learner.md +0 -415
- package/.claude/agents/reasoning/context-synthesizer.md +0 -532
- package/.claude/agents/reasoning/experience-curator.md +0 -562
- package/.claude/agents/reasoning/goal-planner.md +0 -73
- package/.claude/agents/reasoning/memory-optimizer.md +0 -579
- package/.claude/agents/reasoning/pattern-matcher.md +0 -591
- package/.claude/agents/reasoning/reasoning-optimized.md +0 -587
- package/.claude/commands/coordination/README.md +0 -9
- package/.claude/commands/coordination/agent-spawn.md +0 -25
- package/.claude/commands/coordination/init.md +0 -44
- package/.claude/commands/coordination/orchestrate.md +0 -43
- package/.claude/commands/coordination/spawn.md +0 -45
- package/.claude/commands/coordination/swarm-init.md +0 -85
- package/.claude/commands/coordination/task-orchestrate.md +0 -25
- package/.claude/commands/memory/README.md +0 -9
- package/.claude/commands/memory/memory-persist.md +0 -25
- package/.claude/commands/memory/memory-search.md +0 -25
- package/.claude/commands/memory/memory-usage.md +0 -25
- package/.claude/commands/memory/neural.md +0 -47
- package/.claude/commands/memory/usage.md +0 -46
- package/.claude/skills/agentdb-advanced/SKILL.md +0 -550
- package/.claude/skills/agentdb-learning/SKILL.md +0 -545
- package/.claude/skills/agentdb-memory-patterns/SKILL.md +0 -339
- package/.claude/skills/agentdb-optimization/SKILL.md +0 -509
- package/.claude/skills/agentdb-vector-search/SKILL.md +0 -339
- package/.claude/skills/flow-nexus-neural/SKILL.md +0 -738
- package/.claude/skills/flow-nexus-platform/SKILL.md +0 -1157
- package/.claude/skills/flow-nexus-swarm/SKILL.md +0 -610
- package/.claude/skills/github-code-review/SKILL.md +0 -1140
- package/.claude/skills/github-multi-repo/SKILL.md +0 -874
- package/.claude/skills/github-project-management/SKILL.md +0 -1277
- package/.claude/skills/github-release-management/SKILL.md +0 -1081
- package/.claude/skills/github-workflow-automation/SKILL.md +0 -1065
- package/.claude/skills/hive-mind-advanced/SKILL.md +0 -712
- package/.claude/skills/hooks-automation/SKILL.md +0 -1201
- package/.claude/skills/pair-programming/SKILL.md +0 -1202
- package/.claude/skills/performance-analysis/SKILL.md +0 -563
- package/.claude/skills/reasoningbank-agentdb/SKILL.md +0 -446
- package/.claude/skills/reasoningbank-intelligence/SKILL.md +0 -201
- package/.claude/skills/skill-builder/SKILL.md +0 -910
- package/.claude/skills/sparc-methodology/SKILL.md +0 -1115
- package/.claude/skills/stream-chain/SKILL.md +0 -563
- package/.claude/skills/swarm-advanced/SKILL.md +0 -973
- package/.claude/skills/swarm-orchestration/SKILL.md +0 -179
- package/.claude/skills/verification-quality/SKILL.md +0 -649
- package/.claude/statusline-command.sh +0 -176
- package/.claude-flow/metrics/performance.json +0 -87
- package/.claude-flow/metrics/system-metrics.json +0 -2138
- package/.claude-flow/metrics/task-metrics.json +0 -10
- package/.hive-mind/README.md +0 -43
- package/.hive-mind/config/queens.json +0 -59
- package/.hive-mind/config/workers.json +0 -72
- package/.hive-mind/config.json +0 -111
- package/.hive-mind/hive.db +0 -0
- package/.mcp.json +0 -39
- package/.swarm/memory.db +0 -0
- package/.swarm/memory.db-shm +0 -0
- package/.swarm/memory.db-wal +0 -0
- package/CLAUDE.md +0 -354
- package/agentdb.db +0 -0
- package/agentic-flow/.agentdb-instructions.md +0 -66
- package/agentic-flow/.claude/agents/analysis/code-analyzer.md +0 -209
- package/agentic-flow/.claude/agents/analysis/code-review/analyze-code-quality.md +0 -180
- package/agentic-flow/.claude/agents/architecture/system-design/arch-system-design.md +0 -156
- package/agentic-flow/.claude/agents/base-template-generator.md +0 -42
- package/agentic-flow/.claude/agents/consensus/byzantine-coordinator.md +0 -63
- package/agentic-flow/.claude/agents/consensus/crdt-synchronizer.md +0 -997
- package/agentic-flow/.claude/agents/consensus/gossip-coordinator.md +0 -63
- package/agentic-flow/.claude/agents/consensus/performance-benchmarker.md +0 -851
- package/agentic-flow/.claude/agents/consensus/quorum-manager.md +0 -823
- package/agentic-flow/.claude/agents/consensus/raft-manager.md +0 -63
- package/agentic-flow/.claude/agents/consensus/security-manager.md +0 -622
- package/agentic-flow/.claude/agents/core/coder.md +0 -211
- package/agentic-flow/.claude/agents/core/planner.md +0 -116
- package/agentic-flow/.claude/agents/core/researcher.md +0 -136
- package/agentic-flow/.claude/agents/core/reviewer.md +0 -272
- package/agentic-flow/.claude/agents/core/tester.md +0 -266
- package/agentic-flow/.claude/agents/data/ml/data-ml-model.md +0 -193
- package/agentic-flow/.claude/agents/development/backend/dev-backend-api.md +0 -142
- package/agentic-flow/.claude/agents/devops/ci-cd/ops-cicd-github.md +0 -164
- package/agentic-flow/.claude/agents/documentation/api-docs/docs-api-openapi.md +0 -174
- package/agentic-flow/.claude/agents/flow-nexus/app-store.md +0 -88
- package/agentic-flow/.claude/agents/flow-nexus/authentication.md +0 -69
- package/agentic-flow/.claude/agents/flow-nexus/challenges.md +0 -81
- package/agentic-flow/.claude/agents/flow-nexus/neural-network.md +0 -88
- package/agentic-flow/.claude/agents/flow-nexus/payments.md +0 -83
- package/agentic-flow/.claude/agents/flow-nexus/sandbox.md +0 -76
- package/agentic-flow/.claude/agents/flow-nexus/swarm.md +0 -76
- package/agentic-flow/.claude/agents/flow-nexus/user-tools.md +0 -96
- package/agentic-flow/.claude/agents/flow-nexus/workflow.md +0 -84
- package/agentic-flow/.claude/agents/github/code-review-swarm.md +0 -538
- package/agentic-flow/.claude/agents/github/github-modes.md +0 -173
- package/agentic-flow/.claude/agents/github/issue-tracker.md +0 -319
- package/agentic-flow/.claude/agents/github/multi-repo-swarm.md +0 -553
- package/agentic-flow/.claude/agents/github/pr-manager.md +0 -191
- package/agentic-flow/.claude/agents/github/project-board-sync.md +0 -509
- package/agentic-flow/.claude/agents/github/release-manager.md +0 -367
- package/agentic-flow/.claude/agents/github/release-swarm.md +0 -583
- package/agentic-flow/.claude/agents/github/repo-architect.md +0 -398
- package/agentic-flow/.claude/agents/github/swarm-issue.md +0 -573
- package/agentic-flow/.claude/agents/github/swarm-pr.md +0 -428
- package/agentic-flow/.claude/agents/github/sync-coordinator.md +0 -452
- package/agentic-flow/.claude/agents/github/workflow-automation.md +0 -635
- package/agentic-flow/.claude/agents/goal/agent.md +0 -816
- package/agentic-flow/.claude/agents/goal/goal-planner.md +0 -73
- package/agentic-flow/.claude/agents/optimization/benchmark-suite.md +0 -665
- package/agentic-flow/.claude/agents/optimization/load-balancer.md +0 -431
- package/agentic-flow/.claude/agents/optimization/performance-monitor.md +0 -672
- package/agentic-flow/.claude/agents/optimization/resource-allocator.md +0 -674
- package/agentic-flow/.claude/agents/optimization/topology-optimizer.md +0 -808
- package/agentic-flow/.claude/agents/sparc/architecture.md +0 -472
- package/agentic-flow/.claude/agents/sparc/pseudocode.md +0 -318
- package/agentic-flow/.claude/agents/sparc/refinement.md +0 -525
- package/agentic-flow/.claude/agents/sparc/specification.md +0 -276
- package/agentic-flow/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -226
- package/agentic-flow/.claude/agents/swarm/adaptive-coordinator.md +0 -396
- package/agentic-flow/.claude/agents/swarm/hierarchical-coordinator.md +0 -256
- package/agentic-flow/.claude/agents/swarm/mesh-coordinator.md +0 -392
- package/agentic-flow/.claude/agents/templates/automation-smart-agent.md +0 -205
- package/agentic-flow/.claude/agents/templates/coordinator-swarm-init.md +0 -90
- package/agentic-flow/.claude/agents/templates/github-pr-manager.md +0 -177
- package/agentic-flow/.claude/agents/templates/implementer-sparc-coder.md +0 -259
- package/agentic-flow/.claude/agents/templates/memory-coordinator.md +0 -187
- package/agentic-flow/.claude/agents/templates/migration-plan.md +0 -746
- package/agentic-flow/.claude/agents/templates/orchestrator-task.md +0 -139
- package/agentic-flow/.claude/agents/templates/performance-analyzer.md +0 -199
- package/agentic-flow/.claude/agents/templates/sparc-coordinator.md +0 -183
- package/agentic-flow/.claude/agents/testing/unit/tdd-london-swarm.md +0 -244
- package/agentic-flow/.claude/agents/testing/validation/production-validator.md +0 -395
- package/agentic-flow/.claude/commands/agents/README.md +0 -10
- package/agentic-flow/.claude/commands/agents/agent-capabilities.md +0 -21
- package/agentic-flow/.claude/commands/agents/agent-coordination.md +0 -28
- package/agentic-flow/.claude/commands/agents/agent-spawning.md +0 -28
- package/agentic-flow/.claude/commands/agents/agent-types.md +0 -26
- package/agentic-flow/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +0 -54
- package/agentic-flow/.claude/commands/analysis/README.md +0 -9
- package/agentic-flow/.claude/commands/analysis/bottleneck-detect.md +0 -162
- package/agentic-flow/.claude/commands/analysis/performance-bottlenecks.md +0 -59
- package/agentic-flow/.claude/commands/analysis/performance-report.md +0 -25
- package/agentic-flow/.claude/commands/analysis/token-efficiency.md +0 -45
- package/agentic-flow/.claude/commands/analysis/token-usage.md +0 -25
- package/agentic-flow/.claude/commands/automation/README.md +0 -9
- package/agentic-flow/.claude/commands/automation/auto-agent.md +0 -122
- package/agentic-flow/.claude/commands/automation/self-healing.md +0 -106
- package/agentic-flow/.claude/commands/automation/session-memory.md +0 -90
- package/agentic-flow/.claude/commands/automation/smart-agents.md +0 -73
- package/agentic-flow/.claude/commands/automation/smart-spawn.md +0 -25
- package/agentic-flow/.claude/commands/automation/workflow-select.md +0 -25
- package/agentic-flow/.claude/commands/flow-nexus/app-store.md +0 -124
- package/agentic-flow/.claude/commands/flow-nexus/challenges.md +0 -120
- package/agentic-flow/.claude/commands/flow-nexus/login-registration.md +0 -65
- package/agentic-flow/.claude/commands/flow-nexus/neural-network.md +0 -134
- package/agentic-flow/.claude/commands/flow-nexus/payments.md +0 -116
- package/agentic-flow/.claude/commands/flow-nexus/sandbox.md +0 -83
- package/agentic-flow/.claude/commands/flow-nexus/swarm.md +0 -87
- package/agentic-flow/.claude/commands/flow-nexus/user-tools.md +0 -152
- package/agentic-flow/.claude/commands/flow-nexus/workflow.md +0 -115
- package/agentic-flow/.claude/commands/github/README.md +0 -11
- package/agentic-flow/.claude/commands/github/code-review-swarm.md +0 -514
- package/agentic-flow/.claude/commands/github/code-review.md +0 -25
- package/agentic-flow/.claude/commands/github/github-modes.md +0 -147
- package/agentic-flow/.claude/commands/github/github-swarm.md +0 -121
- package/agentic-flow/.claude/commands/github/issue-tracker.md +0 -292
- package/agentic-flow/.claude/commands/github/issue-triage.md +0 -25
- package/agentic-flow/.claude/commands/github/multi-repo-swarm.md +0 -519
- package/agentic-flow/.claude/commands/github/pr-enhance.md +0 -26
- package/agentic-flow/.claude/commands/github/pr-manager.md +0 -170
- package/agentic-flow/.claude/commands/github/project-board-sync.md +0 -471
- package/agentic-flow/.claude/commands/github/release-manager.md +0 -338
- package/agentic-flow/.claude/commands/github/release-swarm.md +0 -544
- package/agentic-flow/.claude/commands/github/repo-analyze.md +0 -25
- package/agentic-flow/.claude/commands/github/repo-architect.md +0 -367
- package/agentic-flow/.claude/commands/github/swarm-issue.md +0 -482
- package/agentic-flow/.claude/commands/github/swarm-pr.md +0 -285
- package/agentic-flow/.claude/commands/github/sync-coordinator.md +0 -301
- package/agentic-flow/.claude/commands/github/workflow-automation.md +0 -442
- package/agentic-flow/.claude/commands/hive-mind/README.md +0 -17
- package/agentic-flow/.claude/commands/hive-mind/hive-mind-consensus.md +0 -8
- package/agentic-flow/.claude/commands/hive-mind/hive-mind-init.md +0 -18
- package/agentic-flow/.claude/commands/hive-mind/hive-mind-memory.md +0 -8
- package/agentic-flow/.claude/commands/hive-mind/hive-mind-metrics.md +0 -8
- package/agentic-flow/.claude/commands/hive-mind/hive-mind-resume.md +0 -8
- package/agentic-flow/.claude/commands/hive-mind/hive-mind-sessions.md +0 -8
- package/agentic-flow/.claude/commands/hive-mind/hive-mind-spawn.md +0 -21
- package/agentic-flow/.claude/commands/hive-mind/hive-mind-status.md +0 -8
- package/agentic-flow/.claude/commands/hive-mind/hive-mind-stop.md +0 -8
- package/agentic-flow/.claude/commands/hive-mind/hive-mind-wizard.md +0 -8
- package/agentic-flow/.claude/commands/hive-mind/hive-mind.md +0 -27
- package/agentic-flow/.claude/commands/hooks/README.md +0 -11
- package/agentic-flow/.claude/commands/hooks/overview.md +0 -58
- package/agentic-flow/.claude/commands/hooks/post-edit.md +0 -117
- package/agentic-flow/.claude/commands/hooks/post-task.md +0 -112
- package/agentic-flow/.claude/commands/hooks/pre-edit.md +0 -113
- package/agentic-flow/.claude/commands/hooks/pre-task.md +0 -111
- package/agentic-flow/.claude/commands/hooks/session-end.md +0 -118
- package/agentic-flow/.claude/commands/hooks/setup.md +0 -103
- package/agentic-flow/.claude/commands/monitoring/README.md +0 -9
- package/agentic-flow/.claude/commands/monitoring/agent-metrics.md +0 -25
- package/agentic-flow/.claude/commands/monitoring/agents.md +0 -44
- package/agentic-flow/.claude/commands/monitoring/real-time-view.md +0 -25
- package/agentic-flow/.claude/commands/monitoring/status.md +0 -46
- package/agentic-flow/.claude/commands/monitoring/swarm-monitor.md +0 -25
- package/agentic-flow/.claude/commands/optimization/README.md +0 -9
- package/agentic-flow/.claude/commands/optimization/auto-topology.md +0 -62
- package/agentic-flow/.claude/commands/optimization/cache-manage.md +0 -25
- package/agentic-flow/.claude/commands/optimization/parallel-execute.md +0 -25
- package/agentic-flow/.claude/commands/optimization/parallel-execution.md +0 -50
- package/agentic-flow/.claude/commands/optimization/topology-optimize.md +0 -25
- package/agentic-flow/.claude/commands/pair/commands.md +0 -546
- package/agentic-flow/.claude/commands/pair/config.md +0 -510
- package/agentic-flow/.claude/commands/pair/examples.md +0 -512
- package/agentic-flow/.claude/commands/pair/modes.md +0 -348
- package/agentic-flow/.claude/commands/pair/session.md +0 -407
- package/agentic-flow/.claude/commands/pair/start.md +0 -209
- package/agentic-flow/.claude/commands/sparc/analyzer.md +0 -52
- package/agentic-flow/.claude/commands/sparc/architect.md +0 -53
- package/agentic-flow/.claude/commands/sparc/batch-executor.md +0 -54
- package/agentic-flow/.claude/commands/sparc/coder.md +0 -54
- package/agentic-flow/.claude/commands/sparc/debugger.md +0 -54
- package/agentic-flow/.claude/commands/sparc/designer.md +0 -53
- package/agentic-flow/.claude/commands/sparc/documenter.md +0 -54
- package/agentic-flow/.claude/commands/sparc/innovator.md +0 -54
- package/agentic-flow/.claude/commands/sparc/memory-manager.md +0 -54
- package/agentic-flow/.claude/commands/sparc/optimizer.md +0 -54
- package/agentic-flow/.claude/commands/sparc/orchestrator.md +0 -132
- package/agentic-flow/.claude/commands/sparc/researcher.md +0 -54
- package/agentic-flow/.claude/commands/sparc/reviewer.md +0 -54
- package/agentic-flow/.claude/commands/sparc/sparc-modes.md +0 -174
- package/agentic-flow/.claude/commands/sparc/swarm-coordinator.md +0 -54
- package/agentic-flow/.claude/commands/sparc/tdd.md +0 -54
- package/agentic-flow/.claude/commands/sparc/tester.md +0 -54
- package/agentic-flow/.claude/commands/sparc/workflow-manager.md +0 -54
- package/agentic-flow/.claude/commands/stream-chain/pipeline.md +0 -121
- package/agentic-flow/.claude/commands/stream-chain/run.md +0 -70
- package/agentic-flow/.claude/commands/swarm/README.md +0 -15
- package/agentic-flow/.claude/commands/swarm/analysis.md +0 -95
- package/agentic-flow/.claude/commands/swarm/development.md +0 -96
- package/agentic-flow/.claude/commands/swarm/examples.md +0 -168
- package/agentic-flow/.claude/commands/swarm/maintenance.md +0 -102
- package/agentic-flow/.claude/commands/swarm/optimization.md +0 -117
- package/agentic-flow/.claude/commands/swarm/research.md +0 -136
- package/agentic-flow/.claude/commands/swarm/swarm-analysis.md +0 -8
- package/agentic-flow/.claude/commands/swarm/swarm-background.md +0 -8
- package/agentic-flow/.claude/commands/swarm/swarm-init.md +0 -19
- package/agentic-flow/.claude/commands/swarm/swarm-modes.md +0 -8
- package/agentic-flow/.claude/commands/swarm/swarm-monitor.md +0 -8
- package/agentic-flow/.claude/commands/swarm/swarm-spawn.md +0 -19
- package/agentic-flow/.claude/commands/swarm/swarm-status.md +0 -8
- package/agentic-flow/.claude/commands/swarm/swarm-strategies.md +0 -8
- package/agentic-flow/.claude/commands/swarm/swarm.md +0 -27
- package/agentic-flow/.claude/commands/swarm/testing.md +0 -131
- package/agentic-flow/.claude/commands/training/README.md +0 -9
- package/agentic-flow/.claude/commands/training/model-update.md +0 -25
- package/agentic-flow/.claude/commands/training/neural-patterns.md +0 -74
- package/agentic-flow/.claude/commands/training/neural-train.md +0 -25
- package/agentic-flow/.claude/commands/training/pattern-learn.md +0 -25
- package/agentic-flow/.claude/commands/training/specialization.md +0 -63
- package/agentic-flow/.claude/commands/truth/start.md +0 -143
- package/agentic-flow/.claude/commands/verify/check.md +0 -50
- package/agentic-flow/.claude/commands/verify/start.md +0 -128
- package/agentic-flow/.claude/commands/workflows/README.md +0 -9
- package/agentic-flow/.claude/commands/workflows/development.md +0 -78
- package/agentic-flow/.claude/commands/workflows/research.md +0 -63
- package/agentic-flow/.claude/commands/workflows/workflow-create.md +0 -25
- package/agentic-flow/.claude/commands/workflows/workflow-execute.md +0 -25
- package/agentic-flow/.claude/commands/workflows/workflow-export.md +0 -25
- package/agentic-flow/.claude/helpers/checkpoint-manager.sh +0 -251
- package/agentic-flow/.claude/helpers/github-safe.js +0 -106
- package/agentic-flow/.claude/helpers/github-setup.sh +0 -28
- package/agentic-flow/.claude/helpers/quick-start.sh +0 -19
- package/agentic-flow/.claude/helpers/setup-mcp.sh +0 -18
- package/agentic-flow/.claude/helpers/standard-checkpoint-hooks.sh +0 -179
- package/agentic-flow/.claude/settings.json +0 -114
- package/agentic-flow/.claude/settings.local.json +0 -14
- package/agentic-flow/.claude/skills/skill-builder/.claude-flow/metrics/agent-metrics.json +0 -1
- package/agentic-flow/AGENT-BOOSTER-STATUS.md +0 -292
- package/agentic-flow/CHANGELOG-v1.3.0.md +0 -120
- package/agentic-flow/CHANGELOG.md +0 -1023
- package/agentic-flow/COMPLETION_REPORT_v1.7.1.md +0 -335
- package/agentic-flow/DOCKER-VERIFICATION.md +0 -207
- package/agentic-flow/IMPLEMENTATION_SUMMARY_v1.7.1.md +0 -241
- package/agentic-flow/NPX_AGENTDB_SETUP.md +0 -175
- package/agentic-flow/PUBLISH_GUIDE.md +0 -438
- package/agentic-flow/PUBLISH_SUMMARY_v1.7.1.md +0 -198
- package/agentic-flow/Python/AddTwoNumbers.py +0 -2
- package/agentic-flow/README.md +0 -577
- package/agentic-flow/RELEASE_NOTES_v1.7.0.md +0 -297
- package/agentic-flow/RELEASE_v1.7.1.md +0 -327
- package/agentic-flow/SUPABASE-INTEGRATION-COMPLETE.md +0 -357
- package/agentic-flow/TESTING_QUICK_START.md +0 -223
- package/agentic-flow/TOOL-EMULATION-INTEGRATION-ISSUE.md +0 -669
- package/agentic-flow/VALIDATION_v1.7.1.md +0 -234
- package/agentic-flow/add_two_numbers.py +0 -2
- package/agentic-flow/agentdb.db +0 -0
- package/agentic-flow/agentic-flow/.claude-flow/metrics/agent-metrics.json +0 -1
- package/agentic-flow/agentic-flow/.claude-flow/metrics/performance.json +0 -87
- package/agentic-flow/agentic-flow/.claude-flow/metrics/task-metrics.json +0 -10
- package/agentic-flow/app/app.py +0 -0
- package/agentic-flow/config/.mcp.json +0 -22
- package/agentic-flow/config/router.config.example.json +0 -224
- package/agentic-flow/config/router.config.json +0 -224
- package/agentic-flow/deployment/.claude-settings.json +0 -14
- package/agentic-flow/docker/claude-agent-sdk/docker/claude-agent-sdk/FASTMCP_SUMMARY.md +0 -369
- package/agentic-flow/docker/claude-agent-sdk/docker/claude-agent-sdk/docs/ARCHITECTURE.md +0 -385
- package/agentic-flow/docker/claude-agent-sdk/docker/claude-agent-sdk/docs/fastmcp-implementation.md +0 -351
- package/agentic-flow/docker/claude-agent-sdk/docker/claude-agent-sdk/docs/fastmcp-quick-start.md +0 -358
- package/agentic-flow/docker/claude-agent-sdk/docker/claude-agent-sdk/src/mcp/fastmcp/README.md +0 -340
- package/agentic-flow/docker/fastmcp-test.Dockerfile +0 -24
- package/agentic-flow/docker/federation-test/.claude-flow/metrics/agent-metrics.json +0 -1
- package/agentic-flow/docker/federation-test/.claude-flow/metrics/performance.json +0 -87
- package/agentic-flow/docker/federation-test/.claude-flow/metrics/task-metrics.json +0 -10
- package/agentic-flow/docker/federation-test/README.md +0 -314
- package/agentic-flow/docker/federation-test/run-test.sh +0 -65
- package/agentic-flow/docker/federation-test/standalone-agent.js +0 -180
- package/agentic-flow/docker/federation-test/standalone-hub.js +0 -85
- package/agentic-flow/docker/federation-test/test-published-hub.js +0 -66
- package/agentic-flow/docker/test-instance/.claude-flow/metrics/agent-metrics.json +0 -1
- package/agentic-flow/docker/test-instance/.claude-flow/metrics/performance.json +0 -87
- package/agentic-flow/docker/test-instance/.claude-flow/metrics/task-metrics.json +0 -10
- package/agentic-flow/docker/test-instance/.env.example +0 -51
- package/agentic-flow/docker/test-instance/COMPREHENSIVE_TEST_RESULTS.md +0 -766
- package/agentic-flow/docker/test-instance/DOCKER_VALIDATION_SUMMARY.md +0 -417
- package/agentic-flow/docker/test-instance/FIX_VALIDATION_REPORT.md +0 -619
- package/agentic-flow/docker/test-instance/INDEX.md +0 -282
- package/agentic-flow/docker/test-instance/QUICK_START.md +0 -217
- package/agentic-flow/docker/test-instance/README.md +0 -266
- package/agentic-flow/docker/test-instance/VALIDATION_REPORT.md +0 -424
- package/agentic-flow/docker/test-instance/test-model-config.md +0 -69
- package/agentic-flow/docker/test-instance/test-runner.sh +0 -91
- package/agentic-flow/docker/test-v1.1.10.dockerfile +0 -12
- package/agentic-flow/docker/test-validation.sh +0 -37
- package/agentic-flow/docker-test.sh +0 -77
- package/agentic-flow/docs/.claude-flow/metrics/agent-metrics.json +0 -1
- package/agentic-flow/docs/.claude-flow/metrics/performance.json +0 -87
- package/agentic-flow/docs/.claude-flow/metrics/task-metrics.json +0 -10
- package/agentic-flow/docs/CLAUDE.md +0 -352
- package/agentic-flow/docs/INDEX.md +0 -279
- package/agentic-flow/docs/LICENSE +0 -21
- package/agentic-flow/docs/architecture/EXECUTIVE_SUMMARY.md +0 -310
- package/agentic-flow/docs/architecture/IMPROVEMENT_PLAN.md +0 -11
- package/agentic-flow/docs/architecture/INTEGRATION-STATUS.md +0 -290
- package/agentic-flow/docs/architecture/MULTI_MODEL_ROUTER_PLAN.md +0 -620
- package/agentic-flow/docs/architecture/PACKAGE_STRUCTURE.md +0 -199
- package/agentic-flow/docs/architecture/QUIC-IMPLEMENTATION-SUMMARY.md +0 -490
- package/agentic-flow/docs/architecture/QUIC-SWARM-INTEGRATION.md +0 -593
- package/agentic-flow/docs/architecture/QUICK_WINS.md +0 -333
- package/agentic-flow/docs/architecture/README.md +0 -15
- package/agentic-flow/docs/architecture/RESEARCH_SUMMARY.md +0 -652
- package/agentic-flow/docs/guides/.claude-flow/metrics/agent-metrics.json +0 -1
- package/agentic-flow/docs/guides/.claude-flow/metrics/performance.json +0 -9
- package/agentic-flow/docs/guides/.claude-flow/metrics/task-metrics.json +0 -10
- package/agentic-flow/docs/guides/ADDING-MCP-SERVERS-CLI.md +0 -515
- package/agentic-flow/docs/guides/ADDING-MCP-SERVERS.md +0 -642
- package/agentic-flow/docs/guides/AGENT-BOOSTER.md +0 -435
- package/agentic-flow/docs/guides/ALTERNATIVE_LLM_MODELS.md +0 -524
- package/agentic-flow/docs/guides/CLAUDE-CODE-INTEGRATION.md +0 -403
- package/agentic-flow/docs/guides/DEPLOYMENT.md +0 -906
- package/agentic-flow/docs/guides/DOCKER_AGENT_USAGE.md +0 -352
- package/agentic-flow/docs/guides/IMPLEMENTATION_EXAMPLES.md +0 -960
- package/agentic-flow/docs/guides/MCP-TOOLS.md +0 -1166
- package/agentic-flow/docs/guides/MODEL-ID-MAPPING.md +0 -193
- package/agentic-flow/docs/guides/MULTI-MODEL-ROUTER.md +0 -702
- package/agentic-flow/docs/guides/NPM-PUBLISH.md +0 -218
- package/agentic-flow/docs/guides/ONNX-PROXY-IMPLEMENTATION.md +0 -254
- package/agentic-flow/docs/guides/ONNX_CLI_USAGE.md +0 -344
- package/agentic-flow/docs/guides/ONNX_OPTIMIZATION_GUIDE.md +0 -665
- package/agentic-flow/docs/guides/OPENROUTER_DEPLOYMENT.md +0 -495
- package/agentic-flow/docs/guides/PROXY-ARCHITECTURE-AND-EXTENSION.md +0 -708
- package/agentic-flow/docs/guides/QUIC-SWARM-QUICKSTART.md +0 -543
- package/agentic-flow/docs/guides/README.md +0 -17
- package/agentic-flow/docs/guides/REASONINGBANK.md +0 -721
- package/agentic-flow/docs/guides/STANDALONE_PROXY_GUIDE.md +0 -437
- package/agentic-flow/docs/guides/agent-sdk.md +0 -234
- package/agentic-flow/docs/reports/QUIC_PHASE1_COMPLETE.md +0 -409
- package/agentic-flow/docs/reports/QUIC_PHASE1_COMPLETION.md +0 -323
- package/agentic-flow/docs/reviews/quic-implementation-review.md +0 -1076
- package/agentic-flow/docs/router/.claude-flow/metrics/agent-metrics.json +0 -1
- package/agentic-flow/docs/router/.claude-flow/metrics/performance.json +0 -9
- package/agentic-flow/docs/router/.claude-flow/metrics/task-metrics.json +0 -10
- package/agentic-flow/examples/PHASE-2-INTEGRATION-GUIDE.md +0 -380
- package/agentic-flow/examples/PHASE-2-TEST-REPORT.md +0 -325
- package/agentic-flow/examples/REGRESSION-TEST-RESULTS.md +0 -334
- package/agentic-flow/examples/TOOL-EMULATION-ARCHITECTURE.md +0 -473
- package/agentic-flow/examples/VALIDATION-SUMMARY.md +0 -323
- package/agentic-flow/examples/agentdb-memory-patterns/.claude-flow/metrics/agent-metrics.json +0 -1
- package/agentic-flow/examples/agentdb-memory-patterns/.claude-flow/metrics/performance.json +0 -87
- package/agentic-flow/examples/agentdb-memory-patterns/.claude-flow/metrics/task-metrics.json +0 -10
- package/agentic-flow/examples/crispr-cas13-pipeline/.github/workflows/ci.yml +0 -341
- package/agentic-flow/examples/crispr-cas13-pipeline/CONTRIBUTING.md +0 -388
- package/agentic-flow/examples/crispr-cas13-pipeline/Cargo.lock +0 -5323
- package/agentic-flow/examples/crispr-cas13-pipeline/Cargo.toml +0 -105
- package/agentic-flow/examples/crispr-cas13-pipeline/DELIVERABLES.md +0 -140
- package/agentic-flow/examples/crispr-cas13-pipeline/LICENSE +0 -32
- package/agentic-flow/examples/crispr-cas13-pipeline/PROJECT_SUMMARY.md +0 -515
- package/agentic-flow/examples/crispr-cas13-pipeline/PUBLISHING_NOTES.md +0 -171
- package/agentic-flow/examples/crispr-cas13-pipeline/PUBLISH_CHECKLIST.md +0 -216
- package/agentic-flow/examples/crispr-cas13-pipeline/README.md +0 -591
- package/agentic-flow/examples/crispr-cas13-pipeline/TEST_SUITE_SUMMARY.md +0 -318
- package/agentic-flow/examples/crispr-cas13-pipeline/benches/alignment_benchmark.rs +0 -207
- package/agentic-flow/examples/crispr-cas13-pipeline/benches/api_benchmark.rs +0 -346
- package/agentic-flow/examples/crispr-cas13-pipeline/benches/comprehensive_benchmarks.rs +0 -362
- package/agentic-flow/examples/crispr-cas13-pipeline/benches/immune_analysis_benchmark.rs +0 -369
- package/agentic-flow/examples/crispr-cas13-pipeline/benches/offtarget_prediction_benchmark.rs +0 -291
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/alignment-engine/Cargo.toml +0 -23
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/alignment-engine/src/bwa.rs +0 -255
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/alignment-engine/src/error.rs +0 -34
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/alignment-engine/src/lib.rs +0 -136
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/alignment-engine/src/quality.rs +0 -287
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/alignment-engine/tests/alignment_test.rs +0 -230
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/api-service/Cargo.toml +0 -32
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/api-service/src/error.rs +0 -38
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/api-service/src/main.rs +0 -41
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/api-service/src/routes.rs +0 -56
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/api-service/tests/api_test.rs +0 -306
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/data-models/Cargo.toml +0 -17
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/data-models/src/error.rs +0 -31
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/data-models/src/expression.rs +0 -313
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/data-models/src/lib.rs +0 -27
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/data-models/src/metadata.rs +0 -302
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/data-models/src/sequencing.rs +0 -240
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/data-models/src/targets.rs +0 -281
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/data-models/tests/models_test.rs +0 -155
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/immune-analyzer/Cargo.toml +0 -24
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/immune-analyzer/src/deseq.rs +0 -265
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/immune-analyzer/src/error.rs +0 -28
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/immune-analyzer/src/lib.rs +0 -10
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/immune-analyzer/src/normalization.rs +0 -173
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/immune-analyzer/src/pathways.rs +0 -195
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/immune-analyzer/tests/analysis_test.rs +0 -258
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/offtarget-predictor/Cargo.toml +0 -26
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/offtarget-predictor/src/error.rs +0 -34
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/offtarget-predictor/src/features.rs +0 -272
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/offtarget-predictor/src/lib.rs +0 -72
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/offtarget-predictor/src/ml_model.rs +0 -264
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/offtarget-predictor/src/scoring.rs +0 -292
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/offtarget-predictor/tests/prediction_test.rs +0 -245
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/processing-orchestrator/Cargo.toml +0 -26
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/processing-orchestrator/src/jobs.rs +0 -27
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/processing-orchestrator/src/main.rs +0 -35
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/processing-orchestrator/src/scheduler.rs +0 -24
- package/agentic-flow/examples/crispr-cas13-pipeline/crates/processing-orchestrator/src/workers.rs +0 -17
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/ARCHITECTURAL_DECISIONS.md +0 -429
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/ARCHITECTURE.md +0 -2964
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/ARCHITECTURE_SUMMARY.md +0 -286
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/BENCHMARKS.md +0 -380
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/PSEUDOCODE.md +0 -354
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/REVIEW_REPORT.md +0 -543
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/RIGHTS_PRESERVING_PLATFORM.md +0 -342
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/SECURITY_AUDIT.md +0 -756
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/SPECIFICATION.md +0 -719
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/TESTING_GUIDE.md +0 -575
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/algorithms/README.md +0 -121
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/algorithms/alignment-module.md +0 -868
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/algorithms/expression-module.md +0 -928
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/algorithms/offtarget-module.md +0 -1030
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/algorithms/reporting-module.md +0 -1135
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/api-spec.openapi.yaml +0 -1258
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/architecture-diagrams/c4-component.md +0 -240
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/architecture-diagrams/c4-container.md +0 -223
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/architecture-diagrams/c4-context.md +0 -86
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/architecture-diagrams/sequence-diagrams.md +0 -499
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/data-layer/schema.sql +0 -363
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/data-models.yaml +0 -1639
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/database-schemas.sql +0 -731
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/deployment/alignment-service.yaml +0 -171
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/deployment/api-gateway.yaml +0 -253
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/deployment/namespace.yaml +0 -26
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/deployment/postgresql.yaml +0 -119
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/docker/alignment-service/requirements.txt +0 -18
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/docker/diff-expr-service/requirements.txt +0 -19
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/docker/off-target-service/requirements.txt +0 -27
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/flowcharts/README.md +0 -130
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/flowcharts/alignment-flowchart.md +0 -221
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/flowcharts/expression-flowchart.md +0 -426
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/flowcharts/offtarget-flowchart.md +0 -317
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/flowcharts/reporting-flowchart.md +0 -502
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/mongodb-collections.json +0 -759
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/monitoring/alerts.yml +0 -291
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/monitoring/grafana-dashboard-system-overview.json +0 -236
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/monitoring/prometheus.yml +0 -213
- package/agentic-flow/examples/crispr-cas13-pipeline/docs/security/oauth2-authentication.md +0 -478
- package/agentic-flow/examples/crispr-cas13-pipeline/src/api/gateway.rs +0 -257
- package/agentic-flow/examples/crispr-cas13-pipeline/src/api/mod.rs +0 -1
- package/agentic-flow/examples/crispr-cas13-pipeline/src/audit/logger.rs +0 -345
- package/agentic-flow/examples/crispr-cas13-pipeline/src/audit/mod.rs +0 -1
- package/agentic-flow/examples/crispr-cas13-pipeline/src/governance/mod.rs +0 -1
- package/agentic-flow/examples/crispr-cas13-pipeline/src/governance/policy.rs +0 -339
- package/agentic-flow/examples/crispr-cas13-pipeline/src/lib.rs +0 -227
- package/agentic-flow/examples/crispr-cas13-pipeline/src/main.rs +0 -114
- package/agentic-flow/examples/crispr-cas13-pipeline/src/privacy/differential.rs +0 -303
- package/agentic-flow/examples/crispr-cas13-pipeline/src/privacy/mod.rs +0 -1
- package/agentic-flow/examples/crispr-cas13-pipeline/src/services/grpc.rs +0 -358
- package/agentic-flow/examples/crispr-cas13-pipeline/src/services/mod.rs +0 -1
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/README.md +0 -336
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/TESTING_SUMMARY.md +0 -386
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/TEST_COVERAGE_REPORT.md +0 -347
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/fixtures/mod.rs +0 -400
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/integration/enhanced_integration_tests.rs +0 -432
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/integration_test.rs +0 -340
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/load_testing_k6.js +0 -269
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/load_testing_locust.py +0 -290
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/property/enhanced_property_tests.rs +0 -479
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/property_tests.rs +0 -371
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/rights_preserving_test.rs +0 -251
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/unit/alignment_tests.rs +0 -307
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/unit/api_service_tests.rs +0 -376
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/unit/data_models_tests.rs +0 -283
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/unit/immune_analyzer_tests.rs +0 -374
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/unit/offtarget_tests.rs +0 -334
- package/agentic-flow/examples/crispr-cas13-pipeline/tests/unit/orchestrator_tests.rs +0 -466
- package/agentic-flow/examples/federated-agentdb/README.md +0 -494
- package/agentic-flow/memory-backup.json +0 -48
- package/agentic-flow/package-lock.json +0 -3974
- package/agentic-flow/package.json +0 -182
- package/agentic-flow/patches/agentdb-fix-imports.patch +0 -13
- package/agentic-flow/path/to/file.py +0 -2
- package/agentic-flow/path/to/your/script.py +0 -2
- package/agentic-flow/python/calculation.py +0 -1
- package/agentic-flow/python/operation.py +0 -1
- package/agentic-flow/run-agentdb.sh +0 -8
- package/agentic-flow/supabase/.temp/cli-latest +0 -1
- package/agentic-flow/supabase/.temp/gotrue-version +0 -1
- package/agentic-flow/supabase/.temp/pooler-url +0 -1
- package/agentic-flow/supabase/.temp/postgres-version +0 -1
- package/agentic-flow/supabase/.temp/project-ref +0 -1
- package/agentic-flow/supabase/.temp/rest-version +0 -1
- package/agentic-flow/supabase/.temp/storage-migration +0 -1
- package/agentic-flow/supabase/.temp/storage-version +0 -1
- package/agentic-flow/test-tool-commands.sh +0 -26
- package/agentic-llm/DEPLOYMENT_STATUS_UPDATE.md +0 -30
- package/agentic-llm/MONITOR_SUMMARY.md +0 -116
- package/agentic-llm/benchmarks/DEPLOYMENT_SUMMARY.md +0 -106
- package/agentic-llm/benchmarks/benchmark.py +0 -419
- package/agentic-llm/benchmarks/comparison/optimization_comparison.json +0 -57
- package/agentic-llm/benchmarks/finetune_comparison.py +0 -252
- package/agentic-llm/benchmarks/results/.gitkeep +0 -2
- package/agentic-llm/benchmarks/results/README.md +0 -59
- package/agentic-llm/benchmarks/results/agent-booster-results.json +0 -116
- package/agentic-llm/benchmarks/results/morph-baseline-results.json +0 -168
- package/agentic-llm/benchmarks/run_comparison.py +0 -246
- package/agentic-llm/check-training.sh +0 -27
- package/agentic-llm/claude_sdk/integration.py +0 -335
- package/agentic-llm/cloudrun/cloud_runner.py +0 -390
- package/agentic-llm/cloudrun/deploy.sh +0 -83
- package/agentic-llm/cloudrun/entrypoint.sh +0 -10
- package/agentic-llm/cloudrun/health_server.py +0 -114
- package/agentic-llm/cloudrun/setup-secrets.sh +0 -26
- package/agentic-llm/cloudrun/upload_to_huggingface.py +0 -277
- package/agentic-llm/configs/training_config.json +0 -71
- package/agentic-llm/deployment/DEPLOYMENT_INSTRUCTIONS.md +0 -93
- package/agentic-llm/deployment/fly.toml +0 -52
- package/agentic-llm/docs/BENCHMARK_OPTIMIZATION_GUIDE.md +0 -435
- package/agentic-llm/docs/CLOUD_RUN_DEPLOYMENT.md +0 -368
- package/agentic-llm/docs/DEPLOYMENT_GUIDE.md +0 -475
- package/agentic-llm/docs/DEPLOYMENT_READY.txt +0 -98
- package/agentic-llm/docs/DEPLOYMENT_STATUS.md +0 -389
- package/agentic-llm/docs/DEPLOYMENT_SUMMARY.md +0 -358
- package/agentic-llm/docs/DEPLOY_STATUS.md +0 -69
- package/agentic-llm/docs/FINETUNING_GUIDE.md +0 -483
- package/agentic-llm/docs/INDEX.md +0 -43
- package/agentic-llm/docs/OPTIMIZATION_RESULTS.md +0 -375
- package/agentic-llm/docs/PHI4_FINETUNING_RESEARCH.md +0 -1352
- package/agentic-llm/docs/QUICKSTART.md +0 -124
- package/agentic-llm/docs/README.md +0 -389
- package/agentic-llm/docs/TRAINING_MONITOR.md +0 -77
- package/agentic-llm/docs/USAGE_GUIDE.md +0 -499
- package/agentic-llm/monitor-loop.sh +0 -52
- package/agentic-llm/monitor-training.sh +0 -56
- package/agentic-llm/quantization/quantize.py +0 -255
- package/agentic-llm/requirements.txt +0 -43
- package/agentic-llm/scripts/deploy.sh +0 -120
- package/agentic-llm/scripts/run_benchmarks.sh +0 -53
- package/agentic-llm/scripts/run_finetuning.sh +0 -90
- package/agentic-llm/scripts/test_local.sh +0 -77
- package/agentic-llm/training/data/mcp_tools_dataset.json +0 -140
- package/agentic-llm/training/finetune_mcp.py +0 -306
- package/agentic-llm/training/mcp_dataset.py +0 -395
- package/agentic-llm/training/train.py +0 -347
- package/agentic-llm/validation/data/mcp_validation_set.json +0 -37
- package/agentic-llm/validation/mcp_validator.py +0 -267
- package/agentic-llm/validation/validator.py +0 -319
- package/bench/.claude-flow/metrics/agent-metrics.json +0 -1
- package/bench/.claude-flow/metrics/performance.json +0 -9
- package/bench/.claude-flow/metrics/task-metrics.json +0 -10
- package/bench/BENCHMARK-GUIDE.md +0 -506
- package/bench/BENCHMARK-RESULTS-TEMPLATE.md +0 -253
- package/bench/COMPLETION-SUMMARY.md +0 -409
- package/bench/README.md +0 -217
- package/bench/agents/baseline-agent.js +0 -69
- package/bench/agents/baseline-agent.ts +0 -78
- package/bench/agents/reasoningbank-agent.js +0 -141
- package/bench/agents/reasoningbank-agent.ts +0 -173
- package/bench/benchmark.js +0 -244
- package/bench/benchmark.ts +0 -309
- package/bench/config.json +0 -79
- package/bench/lib/metrics.js +0 -163
- package/bench/lib/metrics.ts +0 -216
- package/bench/lib/report-generator.js +0 -252
- package/bench/lib/report-generator.ts +0 -266
- package/bench/lib/types.js +0 -4
- package/bench/lib/types.ts +0 -117
- package/bench/package.json +0 -36
- package/bench/run-benchmark.sh +0 -67
- package/bench/scenarios/api-design-tasks.js +0 -175
- package/bench/scenarios/api-design-tasks.ts +0 -199
- package/bench/scenarios/coding-tasks.js +0 -199
- package/bench/scenarios/coding-tasks.ts +0 -223
- package/bench/scenarios/debugging-tasks.js +0 -216
- package/bench/scenarios/debugging-tasks.ts +0 -234
- package/bench/scenarios/problem-solving-tasks.js +0 -172
- package/bench/scenarios/problem-solving-tasks.ts +0 -196
- package/bench/tsconfig.json +0 -26
- package/benchmarks/quic-transport.bench.ts +0 -584
- package/claude-flow +0 -34
- package/crates/agentic-flow-quic/.claude-flow/metrics/agent-metrics.json +0 -1
- package/crates/agentic-flow-quic/.claude-flow/metrics/performance.json +0 -87
- package/crates/agentic-flow-quic/.claude-flow/metrics/task-metrics.json +0 -10
- package/crates/agentic-flow-quic/Cargo.toml +0 -66
- package/crates/agentic-flow-quic/IMPLEMENTATION.md +0 -299
- package/crates/agentic-flow-quic/README.md +0 -75
- package/crates/agentic-flow-quic/benches/quic_bench.rs +0 -229
- package/crates/agentic-flow-quic/build.rs +0 -23
- package/crates/agentic-flow-quic/src/client.rs +0 -242
- package/crates/agentic-flow-quic/src/error.rs +0 -100
- package/crates/agentic-flow-quic/src/lib.rs +0 -76
- package/crates/agentic-flow-quic/src/server.rs +0 -213
- package/crates/agentic-flow-quic/src/types.rs +0 -164
- package/crates/agentic-flow-quic/src/wasm.rs +0 -143
- package/crates/agentic-flow-quic/src/wasm_stub.rs +0 -61
- package/crates/agentic-flow-quic/tests/integration_test.rs +0 -254
- package/crates/agentic-flow-quic/wasm-pack-build.sh +0 -17
- package/crates/sqlite-vector-core/.claude-flow/metrics/agent-metrics.json +0 -1
- package/crates/sqlite-vector-core/.claude-flow/metrics/performance.json +0 -87
- package/crates/sqlite-vector-core/.claude-flow/metrics/task-metrics.json +0 -10
- package/crates/sqlite-vector-core/Cargo.lock +0 -942
- package/crates/sqlite-vector-wasm/.claude-flow/metrics/agent-metrics.json +0 -1
- package/crates/sqlite-vector-wasm/.claude-flow/metrics/performance.json +0 -87
- package/crates/sqlite-vector-wasm/.claude-flow/metrics/task-metrics.json +0 -10
- package/crates/sqlite-vector-wasm/Cargo.lock +0 -499
- package/docs/README.md +0 -85
- package/docs/REORGANIZATION_PLAN.md +0 -102
- package/docs/REORGANIZATION_SUMMARY.md +0 -183
- package/docs/agent-integration-guide.md +0 -483
- package/docs/api/mcp-tools/mcp-documentation-review.md +0 -834
- package/docs/api/mcp-tools/mcp-tools-architecture.md +0 -1082
- package/docs/architecture/FEDERATED-AGENTDB-EPHEMERAL-AGENTS.md +0 -680
- package/docs/architecture/FEDERATION-CLI-VALIDATION-REPORT.md +0 -491
- package/docs/features/README.md +0 -87
- package/docs/features/agent-booster/00-INDEX.md +0 -230
- package/docs/features/agent-booster/00-OVERVIEW.md +0 -454
- package/docs/features/agent-booster/01-ARCHITECTURE.md +0 -699
- package/docs/features/agent-booster/02-INTEGRATION.md +0 -771
- package/docs/features/agent-booster/03-BENCHMARKS.md +0 -616
- package/docs/features/agent-booster/04-NPM-SDK.md +0 -673
- package/docs/features/agent-booster/GITHUB-ISSUE.md +0 -523
- package/docs/features/agent-booster/README.md +0 -44
- package/docs/features/agentdb/AGENTDB-INTEGRATION-COMPLETE.md +0 -590
- package/docs/features/agentdb/AGENTDB-LEARNING-SYSTEMS-REPORT.md +0 -783
- package/docs/features/agentdb/AGENTDB-MCP-SECURITY-AUDIT.md +0 -877
- package/docs/features/agentdb/AGENTDB_INTEGRATION_PLAN.md +0 -776
- package/docs/features/agentdb/CAUSAL_RECALL_SEARCH_IMPLEMENTATION.md +0 -141
- package/docs/features/agentdb/CLI_GUIDE.md +0 -826
- package/docs/features/agentdb/CORE_TOOLS_6-10_IMPLEMENTATION.md +0 -376
- package/docs/features/agentdb/LEARNING_TOOLS_6-10.md +0 -474
- package/docs/features/agentdb/MCP_TOOLS_IMPLEMENTATION.md +0 -373
- package/docs/features/agentdb/README.md +0 -86
- package/docs/features/agentdb/TEST_SUITE_SUMMARY.md +0 -222
- package/docs/features/agentdb/VERSION_1.3.0_RELEASE.md +0 -199
- package/docs/features/agentdb/WASM-VECTOR-IMPLEMENTATION.md +0 -422
- package/docs/features/agentdb/agentdb-code-quality-analysis.md +0 -1050
- package/docs/features/agentdb/agentdb-tools-verification.md +0 -498
- package/docs/features/federation/FEDERATION-CLI-INTEGRATION.md +0 -494
- package/docs/features/federation/FEDERATION-IMPLEMENTATION-SUMMARY.md +0 -546
- package/docs/features/federation/FEDERATION-TEST-REPORT.md +0 -504
- package/docs/features/federation/README.md +0 -35
- package/docs/features/quic/BUILD_INSTRUCTIONS.md +0 -220
- package/docs/features/quic/FINAL-VALIDATION.md +0 -336
- package/docs/features/quic/IMPLEMENTATION-COMPLETE-SUMMARY.md +0 -349
- package/docs/features/quic/IMPLEMENTATION_STATUS.md +0 -234
- package/docs/features/quic/PERFORMANCE-VALIDATION.md +0 -282
- package/docs/features/quic/QUIC-INTEGRATION-SUMMARY.md +0 -545
- package/docs/features/quic/QUIC-INTEGRATION.md +0 -502
- package/docs/features/quic/QUIC-README.md +0 -226
- package/docs/features/quic/QUIC-STATUS-OLD.md +0 -513
- package/docs/features/quic/QUIC-STATUS.md +0 -451
- package/docs/features/quic/QUIC-VALIDATION-REPORT.md +0 -370
- package/docs/features/quic/QUIC_FINAL_STATUS.md +0 -399
- package/docs/features/quic/QUIC_IMPLEMENTATION_SUMMARY.md +0 -607
- package/docs/features/quic/README-CONDENSED.md +0 -447
- package/docs/features/quic/README.md +0 -79
- package/docs/features/quic/README_QUIC_PHASE1.md +0 -117
- package/docs/features/quic/WASM-INTEGRATION-COMPLETE.md +0 -382
- package/docs/features/quic/quic-research.md +0 -1415
- package/docs/features/quic/quic-tutorial.md +0 -485
- package/docs/features/reasoningbank/MEMORY_VALIDATION_REPORT.md +0 -417
- package/docs/features/reasoningbank/README.md +0 -64
- package/docs/features/reasoningbank/REASONING-AGENTS.md +0 -482
- package/docs/features/reasoningbank/REASONINGBANK-BENCHMARK-RESULTS.md +0 -166
- package/docs/features/reasoningbank/REASONINGBANK-BENCHMARK.md +0 -396
- package/docs/features/reasoningbank/REASONINGBANK-CLI-INTEGRATION.md +0 -455
- package/docs/features/reasoningbank/REASONINGBANK-DEMO.md +0 -419
- package/docs/features/reasoningbank/REASONINGBANK-VALIDATION.md +0 -532
- package/docs/features/reasoningbank/REASONINGBANK_ARCHITECTURE.md +0 -663
- package/docs/features/reasoningbank/REASONINGBANK_BACKENDS.md +0 -375
- package/docs/features/reasoningbank/REASONINGBANK_FIXES.md +0 -455
- package/docs/features/reasoningbank/REASONINGBANK_IMPLEMENTATION_STATUS.md +0 -478
- package/docs/features/reasoningbank/REASONINGBANK_INTEGRATION_PLAN.md +0 -1059
- package/docs/features/reasoningbank/REASONINGBANK_INVESTIGATION.md +0 -380
- package/docs/features/router/README.md +0 -38
- package/docs/features/router/ROUTER_CONFIG_REFERENCE.md +0 -577
- package/docs/features/router/ROUTER_USER_GUIDE.md +0 -865
- package/docs/features/router/TOP20_MODELS_MATRIX.md +0 -80
- package/docs/guides/MCP-AUTHENTICATION.md +0 -2017
- package/docs/guides/MCP-QUICKSTART.md +0 -521
- package/docs/guides/MCP-TROUBLESHOOTING.md +0 -1602
- package/docs/guides/NPM_STATS_GUIDE.md +0 -407
- package/docs/parallel-execution-implementation.md +0 -525
- package/docs/plans/.claude-flow/metrics/agent-metrics.json +0 -1
- package/docs/plans/.claude-flow/metrics/performance.json +0 -87
- package/docs/plans/.claude-flow/metrics/task-metrics.json +0 -10
- package/docs/releases/archive/GITHUB-ISSUE-ADDENDUM-v1.4.6.md +0 -1529
- package/docs/releases/archive/GITHUB-ISSUE-BUILD-FIX.md +0 -756
- package/docs/releases/archive/GITHUB-ISSUE-REASONINGBANK-BENCHMARK.md +0 -643
- package/docs/releases/archive/GITHUB-ISSUE-v1.4.6.md +0 -1453
- package/docs/releases/archive/GITHUB-ISSUE-v1.5.0.md +0 -468
- package/docs/releases/archive/HOTFIX-v1.2.1.md +0 -315
- package/docs/releases/archive/INTEGRATION-COMPLETE.md +0 -291
- package/docs/releases/archive/MIGRATION-STATUS.md +0 -118
- package/docs/releases/archive/MIGRATION_v1.7.0.md +0 -299
- package/docs/releases/archive/NPM-PUBLISH-GUIDE-v1.2.0.md +0 -440
- package/docs/releases/archive/PUBLICATION_REPORT_v1.5.11.md +0 -421
- package/docs/releases/archive/PUBLISH-COMPLETE-v1.2.0.md +0 -308
- package/docs/releases/archive/README.md +0 -82
- package/docs/releases/archive/RELEASE-v1.2.0.md +0 -339
- package/docs/releases/archive/VALIDATION_REPORT_v1.7.0.md +0 -418
- package/docs/releases/archive/ZERO-BUILD-MIGRATION.md +0 -227
- package/docs/releases/archive/github-issue-agentdb-integration.md +0 -379
- package/docs/releases/archive/v1.4.6-reasoningbank-release.md +0 -541
- package/docs/releases/archive/v1.4.7-bugfix.md +0 -212
- package/docs/releases/archive/v1.5.14-QUIC-TRANSPORT.md +0 -201
- package/docs/releases/archive/v1.5.9-DOCKER-VERIFICATION.md +0 -263
- package/docs/releases/archive/v1.5.9-RELEASE-SUMMARY.md +0 -222
- package/docs/swarm-optimization-report.md +0 -626
- package/index.html +0 -15
- package/memory/agents/README.md +0 -31
- package/memory/claude-flow@alpha-data.json +0 -5
- package/memory/memory-store.json +0 -69
- package/memory/sessions/README.md +0 -32
- package/src/App.css +0 -5
- package/src/App.tsx +0 -15
- package/src/components/AgentTypes.tsx +0 -122
- package/src/components/CoreComponents.tsx +0 -131
- package/src/components/Features.tsx +0 -102
- package/src/components/Footer.tsx +0 -159
- package/src/components/Hero.tsx +0 -87
- package/src/components/PerformanceMetrics.tsx +0 -125
- package/src/components/QuickStart.tsx +0 -178
- package/src/index.css +0 -87
- package/src/main.tsx +0 -10
- package/src/pages/LandingPage.tsx +0 -23
- package/src/transport/quic.ts +0 -258
- package/tailwind.config.ts +0 -79
- package/vite.config.ts +0 -20
- /package/{agentic-flow/.claude → .claude}/agents/MIGRATION_SUMMARY.md +0 -0
- /package/{agentic-flow/.claude → .claude}/agents/README.md +0 -0
- /package/{agentic-flow/.claude → .claude}/agents/consensus/README.md +0 -0
- /package/{agentic-flow/.claude → .claude}/agents/custom/test-long-runner.md +0 -0
- /package/.claude/agents/{reasoning → goal}/agent.md +0 -0
- /package/{agentic-flow/.claude → .claude}/agents/optimization/README.md +0 -0
- /package/{agentic-flow/.claude → .claude}/agents/payments/agentic-payments.md +0 -0
- /package/{agentic-flow/.claude → .claude}/agents/sublinear/consensus-coordinator.md +0 -0
- /package/{agentic-flow/.claude → .claude}/agents/sublinear/matrix-optimizer.md +0 -0
- /package/{agentic-flow/.claude → .claude}/agents/sublinear/pagerank-analyzer.md +0 -0
- /package/{agentic-flow/.claude → .claude}/agents/sublinear/performance-optimizer.md +0 -0
- /package/{agentic-flow/.claude → .claude}/agents/sublinear/trading-predictor.md +0 -0
- /package/{agentic-flow/.claude → .claude}/agents/swarm/README.md +0 -0
- /package/{agentic-flow/.claude → .claude}/agents/test-neural.md +0 -0
- /package/{agentic-flow/.claude → .claude}/answer.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/claude-flow-help.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/claude-flow-memory.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/claude-flow-swarm.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/pair/README.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/ask.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/code.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/debug.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/devops.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/docs-writer.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/integration.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/mcp.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/post-deployment-monitoring-mode.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/refinement-optimization-mode.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/security-review.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/sparc.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/spec-pseudocode.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/supabase-admin.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc/tutorial.md +0 -0
- /package/{agentic-flow/.claude → .claude}/commands/sparc.md +0 -0
- /package/{agentic-flow/.claude → .claude}/mcp.json +0 -0
- /package/{agentic-flow/.claude → .claude}/openrouter-models-research.md +0 -0
- /package/{agentic-flow/.claude → .claude}/openrouter-quick-reference.md +0 -0
- /package/{agentic-flow/.claude → .claude}/settings-backup.json +0 -0
- /package/{agentic-flow/.claude → .claude}/settings-optimized.json +0 -0
- /package/{agentic-flow/.claude → .claude}/settings-simple.json +0 -0
- /package/{.claude-flow → .claude/skills/.claude-flow}/metrics/agent-metrics.json +0 -0
- /package/{agentic-flow/.claude → .claude}/skills/.claude-flow/metrics/performance.json +0 -0
- /package/{agentic-flow/.claude → .claude}/skills/.claude-flow/metrics/task-metrics.json +0 -0
- /package/{agentic-flow/.claude/skills → .claude/skills/skill-builder}/.claude-flow/metrics/agent-metrics.json +0 -0
- /package/{agentic-flow/.claude → .claude}/skills/skill-builder/.claude-flow/metrics/performance.json +0 -0
- /package/{agentic-flow/.claude → .claude}/skills/skill-builder/.claude-flow/metrics/task-metrics.json +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/benchmarks/comprehensive-benchmark.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/benchmarks/frontier-benchmark.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/benchmarks/reflexion-benchmark.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/cli/agentdb-cli.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/controllers/CausalMemoryGraph.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/controllers/CausalRecall.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/controllers/EmbeddingService.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/controllers/ExplainableRecall.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/controllers/NightlyLearner.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/controllers/ReflexionMemory.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/controllers/SkillLibrary.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/controllers/frontier-index.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/controllers/index.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/index.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/optimizations/BatchOperations.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/optimizations/QueryOptimizer.js +0 -0
- /package/{agentic-flow/dist → dist}/agentdb/optimizations/index.js +0 -0
- /package/{agentic-flow/dist → dist}/agents/claudeAgent.js +0 -0
- /package/{agentic-flow/dist → dist}/agents/claudeAgentDirect.js +0 -0
- /package/{agentic-flow/dist → dist}/agents/claudeFlowAgent.js +0 -0
- /package/{agentic-flow/dist → dist}/agents/codeReviewAgent.js +0 -0
- /package/{agentic-flow/dist → dist}/agents/dataAgent.js +0 -0
- /package/{agentic-flow/dist → dist}/agents/directApiAgent.js +0 -0
- /package/{agentic-flow/dist → dist}/agents/webResearchAgent.js +0 -0
- /package/{agentic-flow/dist → dist}/cli/agent-manager.js +0 -0
- /package/{agentic-flow/dist → dist}/cli/claude-code-wrapper.js +0 -0
- /package/{agentic-flow/dist → dist}/cli/federation-cli.js +0 -0
- /package/{agentic-flow/dist → dist}/cli/mcp-manager.js +0 -0
- /package/{agentic-flow/dist → dist}/cli/mcp.js +0 -0
- /package/{agentic-flow/dist → dist}/cli/skills-manager.js +0 -0
- /package/{agentic-flow/dist → dist}/cli/update-message.js +0 -0
- /package/{agentic-flow/dist → dist}/cli-standalone-proxy.js +0 -0
- /package/{agentic-flow/dist → dist}/config/claudeFlow.js +0 -0
- /package/{agentic-flow/dist → dist}/config/quic.js +0 -0
- /package/{agentic-flow/dist → dist}/config/tools.js +0 -0
- /package/{agentic-flow/dist → dist}/examples/multi-agent-orchestration.js +0 -0
- /package/{agentic-flow/dist → dist}/examples/use-goal-planner.js +0 -0
- /package/{agentic-flow/dist → dist}/federation/EphemeralAgent.js +0 -0
- /package/{agentic-flow/dist → dist}/federation/FederationHub.js +0 -0
- /package/{agentic-flow/dist → dist}/federation/FederationHubClient.js +0 -0
- /package/{agentic-flow/dist → dist}/federation/FederationHubServer.js +0 -0
- /package/{agentic-flow/dist → dist}/federation/SecurityManager.js +0 -0
- /package/{agentic-flow/dist → dist}/federation/debug/agent-debug-stream.js +0 -0
- /package/{agentic-flow/dist → dist}/federation/debug/debug-stream.js +0 -0
- /package/{agentic-flow/dist → dist}/federation/index.js +0 -0
- /package/{agentic-flow/dist → dist}/federation/integrations/realtime-federation.js +0 -0
- /package/{agentic-flow/dist → dist}/federation/integrations/supabase-adapter-debug.js +0 -0
- /package/{agentic-flow/dist → dist}/federation/integrations/supabase-adapter.js +0 -0
- /package/{agentic-flow/dist → dist}/health.js +0 -0
- /package/{agentic-flow/dist → dist}/index.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/claudeFlowSdkServer.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/servers/claude-flow-sdk.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/servers/http-sse.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/servers/http-streaming-updated.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/servers/poc-stdio.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/servers/stdio-full.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/tools/agent/add-agent.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/tools/agent/add-command.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/tools/agent/execute.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/tools/agent/list.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/tools/agent/parallel.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/tools/swarm/init.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/tools/swarm/orchestrate.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/tools/swarm/spawn.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/fastmcp/types/index.js +0 -0
- /package/{agentic-flow/dist → dist}/mcp/standalone-stdio.js +0 -0
- /package/{agentic-flow/dist → dist}/memory/SharedMemoryPool.js +0 -0
- /package/{agentic-flow/dist → dist}/memory/index.js +0 -0
- /package/{agentic-flow/dist → dist}/proxy/anthropic-to-gemini.js +0 -0
- /package/{agentic-flow/dist → dist}/proxy/anthropic-to-onnx.js +0 -0
- /package/{agentic-flow/dist → dist}/proxy/anthropic-to-openrouter.js +0 -0
- /package/{agentic-flow/dist → dist}/proxy/anthropic-to-requesty.js +0 -0
- /package/{agentic-flow/dist → dist}/proxy/quic-proxy.js +0 -0
- /package/{agentic-flow/dist → dist}/proxy/tool-emulation.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/AdvancedMemory.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/HybridBackend.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/agentdb-adapter.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/backend-selector.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/benchmark.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/config/reasoningbank-types.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/config/reasoningbank.yaml +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/core/consolidate.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/core/database.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/core/distill.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/core/judge.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/core/matts.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/core/memory-engine.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/core/retrieve.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/db/queries.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/db/schema.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/demo-comparison.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/hooks/post-task.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/hooks/pre-task.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/index-new.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/index.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/prompts/distill-failure.json +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/prompts/distill-success.json +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/prompts/judge.json +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/prompts/matts-aggregate.json +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/test-integration.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/test-retrieval.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/test-validation.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/types/index.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/utils/config.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/utils/embeddings.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/utils/mmr.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/utils/pii-scrubber.js +0 -0
- /package/{agentic-flow/dist → dist}/reasoningbank/wasm-adapter.js +0 -0
- /package/{agentic-flow/dist → dist}/router/model-mapping.js +0 -0
- /package/{agentic-flow/dist → dist}/router/providers/anthropic.js +0 -0
- /package/{agentic-flow/dist → dist}/router/providers/gemini.js +0 -0
- /package/{agentic-flow/dist → dist}/router/providers/onnx-local-optimized.js +0 -0
- /package/{agentic-flow/dist → dist}/router/providers/onnx-local.js +0 -0
- /package/{agentic-flow/dist → dist}/router/providers/onnx-phi4.js +0 -0
- /package/{agentic-flow/dist → dist}/router/providers/onnx.js +0 -0
- /package/{agentic-flow/dist → dist}/router/providers/openrouter.js +0 -0
- /package/{agentic-flow/dist → dist}/router/router.js +0 -0
- /package/{agentic-flow/dist → dist}/router/test-integration.js +0 -0
- /package/{agentic-flow/dist → dist}/router/test-onnx-benchmark.js +0 -0
- /package/{agentic-flow/dist → dist}/router/test-onnx-integration.js +0 -0
- /package/{agentic-flow/dist → dist}/router/test-onnx-local.js +0 -0
- /package/{agentic-flow/dist → dist}/router/test-onnx.js +0 -0
- /package/{agentic-flow/dist → dist}/router/test-openrouter.js +0 -0
- /package/{agentic-flow/dist → dist}/router/test-phi4.js +0 -0
- /package/{agentic-flow/dist → dist}/router/types.js +0 -0
- /package/{agentic-flow/dist → dist}/swarm/index.js +0 -0
- /package/{agentic-flow/dist → dist}/swarm/quic-coordinator.js +0 -0
- /package/{agentic-flow/dist → dist}/swarm/transport-router.js +0 -0
- /package/{agentic-flow/dist → dist}/transport/index.js +0 -0
- /package/{agentic-flow/dist → dist}/transport/quic-handshake.js +0 -0
- /package/{agentic-flow/dist → dist}/transport/quic.js +0 -0
- /package/{agentic-flow/dist → dist}/utils/agentBoosterPreprocessor.js +0 -0
- /package/{agentic-flow/dist → dist}/utils/agentLoader.js +0 -0
- /package/{agentic-flow/dist → dist}/utils/agentdb-runtime-patch.js +0 -0
- /package/{agentic-flow/dist → dist}/utils/agentdbCommands.js +0 -0
- /package/{agentic-flow/dist → dist}/utils/logger.js +0 -0
- /package/{agentic-flow/dist → dist}/utils/math.js +0 -0
- /package/{agentic-flow/dist → dist}/utils/mcpCommands.js +0 -0
- /package/{agentic-flow/dist → dist}/utils/model-downloader.js +0 -0
- /package/{agentic-flow/dist → dist}/utils/modelCapabilities.js +0 -0
- /package/{agentic-flow/dist → dist}/utils/modelOptimizer.js +0 -0
- /package/{agentic-flow/dist → dist}/utils/reasoningbankCommands.js +0 -0
- /package/{agentic-flow/dist → dist}/utils/retry.js +0 -0
- /package/{agentic-flow/docs → docs}/AGENTDB_TESTING.md +0 -0
- /package/{agentic-flow/docs → docs}/INTEGRATION-COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/QUIC_FINAL_STATUS.md +0 -0
- /package/{agentic-flow/docs → docs}/README_QUIC_PHASE1.md +0 -0
- /package/{agentic-flow/docs → docs}/TEST-V1.7.8.Dockerfile +0 -0
- /package/{agentic-flow/docs → docs}/TEST-V1.7.9-NODE20.Dockerfile +0 -0
- /package/{agentic-flow/docs → docs}/TEST-V1.7.9.Dockerfile +0 -0
- /package/{agentic-flow/docs → docs}/architecture/FEDERATION-DATA-LIFECYCLE.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/COMPLETE_VALIDATION_SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/DOCKER_MCP_VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/DOCKER_OPENROUTER_VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/FASTMCP_COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/FASTMCP_INTEGRATION_STATUS.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/FINAL_SDK_VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/FINAL_SYSTEM_VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/FINAL_VALIDATION_SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/FIXES-APPLIED-STATUS.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/FLOW-NEXUS-COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/HOTFIX_1.1.7.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/INTEGRATION_CONFIRMED.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/MCP_CLI_TOOLS_VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/MCP_INTEGRATION_SUCCESS.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/MCP_PROXY_VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/MODEL_VALIDATION_REPORT.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/ONNX_ENV_VARS.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/ONNX_FINAL_REPORT.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/ONNX_IMPLEMENTATION_COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/ONNX_IMPLEMENTATION_SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/ONNX_INTEGRATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/ONNX_OPTIMIZATION_SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/ONNX_PHI4_RESEARCH.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/ONNX_RUNTIME_INTEGRATION_PLAN.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/ONNX_SUCCESS_REPORT.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/ONNX_VS_CLAUDE_QUALITY.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/OPENROUTER-FIX-VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/OPENROUTER-SUCCESS-REPORT.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/OPENROUTER_ISSUES_AND_FIXES.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/OPENROUTER_PROXY_COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/OPENROUTER_VALIDATION_COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/OPTIMIZATION_SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/PACKAGE-COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/PHI4_HYPEROPTIMIZATION_PLAN.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/PROVIDER_INSTRUCTION_OPTIMIZATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/PROXY_VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/README.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/README_SDK_VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/README_V1.1.11.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/RELEASE-NOTES-v1.1.13.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/RELEASE-SUMMARY-v1.1.14-beta.1.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/RESEARCH_COMPLETE.txt +0 -0
- /package/{agentic-flow/docs → docs}/archived/ROUTER_VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/SDK-SETUP-COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/SDK_INTEGRATION_COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/TOOL_INSTRUCTION_ENHANCEMENT.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/V1.1.10_VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/V1.1.11_COMPLETE_VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/V1.1.11_MCP_PROXY_FIX.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/V1.1.14-BETA-READY.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/VALIDATION-RESULTS.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/VALIDATION_COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/VALIDATION_SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/claude-flow-integration.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/docker-cli-validation.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/docker-memory-coordination-status.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/mcp-validation-summary.md +0 -0
- /package/{agentic-flow/docs → docs}/archived/quick-wins-validation.md +0 -0
- /package/{agentic-flow/docs → docs}/benchmarks/optimization-guide.md +0 -0
- /package/{agentic-flow/docs → docs}/benchmarks/quic-results.md +0 -0
- /package/{agentic-flow/docs → docs}/federation/AGENT-DEBUG-STREAMING.md +0 -0
- /package/{agentic-flow/docs → docs}/federation/DEBUG-STREAMING-COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/federation/DEBUG-STREAMING.md +0 -0
- /package/{agentic-flow/docs → docs}/federation/DEPLOYMENT-VALIDATION-SUCCESS.md +0 -0
- /package/{agentic-flow/docs → docs}/federation/DOCKER-FEDERATION-DEEP-REVIEW.md +0 -0
- /package/{agentic-flow/docs → docs}/integration-docs/AGENT-BOOSTER-INTEGRATION.md +0 -0
- /package/{agentic-flow/docs → docs}/integration-docs/CLAUDE-FLOW-INTEGRATION-ANALYSIS.md +0 -0
- /package/{agentic-flow/docs → docs}/integration-docs/CLI-INTEGRATION-COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/integration-docs/IMPLEMENTATION_SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/integration-docs/INTEGRATION-QUICK-SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/integration-docs/INTEGRATION-STATUS-CORRECTED.md +0 -0
- /package/{agentic-flow/docs → docs}/integration-docs/INTEGRATION_COMPLETE_SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/integration-docs/QUIC-WASM-INTEGRATION.md +0 -0
- /package/{agentic-flow/docs → docs}/integration-docs/README.md +0 -0
- /package/{agentic-flow/docs → docs}/integration-docs/WASM_ESM_FIX.md +0 -0
- /package/{agentic-flow/docs → docs}/integration-docs/WASM_INTEGRATION_COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/integrations/CLAUDE_AGENTS_INTEGRATION.md +0 -0
- /package/{agentic-flow/docs → docs}/integrations/CLAUDE_FLOW_INTEGRATION.md +0 -0
- /package/{agentic-flow/docs → docs}/integrations/FASTMCP_CLI_INTEGRATION.md +0 -0
- /package/{agentic-flow/docs → docs}/integrations/FLOW-NEXUS-INTEGRATION.md +0 -0
- /package/{agentic-flow/docs → docs}/integrations/README.md +0 -0
- /package/{agentic-flow/docs → docs}/integrations/fastmcp-implementation-plan.md +0 -0
- /package/{agentic-flow/docs → docs}/integrations/fastmcp-poc-integration.md +0 -0
- /package/{agentic-flow/docs → docs}/issues/ISSUE-SUPABASE-INTEGRATION.md +0 -0
- /package/{agentic-flow/docs → docs}/mcp-validation/IMPLEMENTATION-SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/mcp-validation/MCP-CLI-VALIDATION-REPORT.md +0 -0
- /package/{agentic-flow/docs → docs}/mcp-validation/README.md +0 -0
- /package/{agentic-flow/docs → docs}/mcp-validation/strange-loops-test.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/QUIC/BUILD_INSTRUCTIONS.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/QUIC/IMPLEMENTATION_STATUS.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/QUIC/QUIC-INTEGRATION-SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/QUIC/QUIC-INTEGRATION.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/QUIC/QUIC-README.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/QUIC/QUIC_IMPLEMENTATION_SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/QUIC/README-CONDENSED.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/QUIC/quic-research.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/QUIC/quic-tutorial.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/agent-booster/00-INDEX.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/agent-booster/00-OVERVIEW.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/agent-booster/01-ARCHITECTURE.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/agent-booster/02-INTEGRATION.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/agent-booster/03-BENCHMARKS.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/agent-booster/04-NPM-SDK.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/agent-booster/GITHUB-ISSUE.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/agent-booster/README.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/agent-booster-cli-integration.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/requesty/00-overview.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/requesty/01-api-research.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/requesty/02-architecture.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/requesty/03-implementation-phases.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/requesty/04-testing-strategy.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/requesty/05-migration-guide.md +0 -0
- /package/{agentic-flow/docs → docs}/plans/requesty/README.md +0 -0
- /package/{agentic-flow/docs → docs}/quantum-goap/DEPENDENCY_GRAPH.mermaid +0 -0
- /package/{agentic-flow/docs → docs}/quantum-goap/EXECUTION_SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/quantum-goap/GOAP_IMPLEMENTATION_PLAN.md +0 -0
- /package/{agentic-flow/docs → docs}/quantum-goap/QUICK_START.md +0 -0
- /package/{agentic-flow/docs → docs}/quantum-research/QUANTUM_RESEARCH_LITERATURE_REVIEW.md +0 -0
- /package/{agentic-flow/docs → docs}/quantum-research/README.md +0 -0
- /package/{agentic-flow/docs → docs}/quic/FINAL-VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/quic/IMPLEMENTATION-COMPLETE-SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/quic/PERFORMANCE-VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/quic/QUIC-STATUS-OLD.md +0 -0
- /package/{agentic-flow/docs → docs}/quic/QUIC-STATUS.md +0 -0
- /package/{agentic-flow/docs → docs}/quic/QUIC-VALIDATION-REPORT.md +0 -0
- /package/{agentic-flow/docs → docs}/quic/WASM-INTEGRATION-COMPLETE.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/MEMORY_VALIDATION_REPORT.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/README.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/REASONING-AGENTS.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/REASONINGBANK-BENCHMARK-RESULTS.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/REASONINGBANK-BENCHMARK.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/REASONINGBANK-CLI-INTEGRATION.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/REASONINGBANK-DEMO.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/REASONINGBANK-VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/REASONINGBANK_ARCHITECTURE.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/REASONINGBANK_BACKENDS.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/REASONINGBANK_FIXES.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/REASONINGBANK_IMPLEMENTATION_STATUS.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/REASONINGBANK_INTEGRATION_PLAN.md +0 -0
- /package/{agentic-flow/docs → docs}/reasoningbank/REASONINGBANK_INVESTIGATION.md +0 -0
- /package/{agentic-flow/docs → docs}/releases/GITHUB-ISSUE-ADDENDUM-v1.4.6.md +0 -0
- /package/{agentic-flow/docs → docs}/releases/GITHUB-ISSUE-REASONINGBANK-BENCHMARK.md +0 -0
- /package/{agentic-flow/docs → docs}/releases/GITHUB-ISSUE-v1.4.6.md +0 -0
- /package/{agentic-flow/docs → docs}/releases/GITHUB-ISSUE-v1.5.0.md +0 -0
- /package/{agentic-flow/docs → docs}/releases/HOTFIX-v1.2.1.md +0 -0
- /package/{agentic-flow/docs → docs}/releases/NPM-PUBLISH-GUIDE-v1.2.0.md +0 -0
- /package/{agentic-flow/docs → docs}/releases/PUBLISH-COMPLETE-v1.2.0.md +0 -0
- /package/{agentic-flow/docs → docs}/releases/README.md +0 -0
- /package/{agentic-flow/docs → docs}/releases/RELEASE-v1.2.0.md +0 -0
- /package/{agentic-flow/docs → docs}/releases/RELEASE-v1.8.13.md +0 -0
- /package/{agentic-flow/docs → docs}/releases/v1.4.6-reasoningbank-release.md +0 -0
- /package/{agentic-flow/docs → docs}/releases/v1.4.7-bugfix.md +0 -0
- /package/{agentic-flow/docs → docs}/releases/v1.5.14-QUIC-TRANSPORT.md +0 -0
- /package/{agentic-flow/docs → docs}/router/README.md +0 -0
- /package/{agentic-flow/docs → docs}/router/ROUTER_CONFIG_REFERENCE.md +0 -0
- /package/{agentic-flow/docs → docs}/router/ROUTER_USER_GUIDE.md +0 -0
- /package/{agentic-flow/docs → docs}/router/TOP20_MODELS_MATRIX.md +0 -0
- /package/{agentic-flow/docs → docs}/supabase/IMPLEMENTATION-SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/supabase/INDEX.md +0 -0
- /package/{agentic-flow/docs → docs}/supabase/QUICKSTART.md +0 -0
- /package/{agentic-flow/docs → docs}/supabase/README.md +0 -0
- /package/{agentic-flow/docs → docs}/supabase/SUPABASE-REALTIME-FEDERATION.md +0 -0
- /package/{agentic-flow/docs → docs}/supabase/TEST-REPORT.md +0 -0
- /package/{agentic-flow/docs → docs}/supabase/migrations/001_create_federation_tables.sql +0 -0
- /package/{agentic-flow/docs → docs}/testing/AGENT-SYSTEM-VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/testing/FINAL-TESTING-SUMMARY.md +0 -0
- /package/{agentic-flow/docs → docs}/testing/README.md +0 -0
- /package/{agentic-flow/docs → docs}/testing/REGRESSION-TEST-RESULTS.md +0 -0
- /package/{agentic-flow/docs → docs}/testing/STREAMING-AND-MCP-VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/v1.7.1-QUICK-START.md +0 -0
- /package/{agentic-flow/docs → docs}/validation/README.md +0 -0
- /package/{agentic-flow/docs → docs}/validation/reports/REGRESSION-TEST-V1.8.11.md +0 -0
- /package/{agentic-flow/docs → docs}/validation-reports/BENCHMARK_AND_OPTIMIZATION_REPORT.md +0 -0
- /package/{agentic-flow/docs → docs}/validation-reports/DOCKER_VALIDATION_RESULTS.md +0 -0
- /package/{agentic-flow/docs → docs}/validation-reports/NO_REGRESSIONS_CONFIRMED.md +0 -0
- /package/{agentic-flow/docs → docs}/validation-reports/NPM-PACKAGE-ANALYSIS-FINAL.md +0 -0
- /package/{agentic-flow/docs → docs}/validation-reports/README.md +0 -0
- /package/{agentic-flow/docs → docs}/validation-reports/V2.7.0-ALPHA.10_FINAL_VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/validation-reports/V2.7.0-ALPHA.9_VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/validation-reports/v1.6.0-QUIC-CLI-VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/validation-reports/v1.6.1-NPM-PUBLISH-VALIDATION.md +0 -0
- /package/{agentic-flow/docs → docs}/version-releases/PUBLICATION_REPORT_v1.5.11.md +0 -0
- /package/{agentic-flow/docs → docs}/version-releases/README.md +0 -0
- /package/{agentic-flow/docs → docs}/version-releases/v1.5.9-DOCKER-VERIFICATION.md +0 -0
- /package/{agentic-flow/docs → docs}/version-releases/v1.5.9-RELEASE-SUMMARY.md +0 -0
- /package/{agentic-flow/scripts → scripts}/build.sh +0 -0
- /package/{agentic-flow/scripts → scripts}/claude-code +0 -0
- /package/{agentic-flow/scripts → scripts}/claude-flow +0 -0
- /package/{agentic-flow/scripts → scripts}/claude-flow.bat +0 -0
- /package/{agentic-flow/scripts → scripts}/claude-flow.ps1 +0 -0
- /package/{agentic-flow/scripts → scripts}/postinstall.js +0 -0
- /package/{agentic-flow/scripts → scripts}/run-validation.sh +0 -0
- /package/{agentic-flow/scripts → scripts}/test-agentdb.sh +0 -0
- /package/{agentic-flow/scripts → scripts}/test-all-commands.sh +0 -0
- /package/{agentic-flow/scripts → scripts}/test-claude-flow-sdk.sh +0 -0
- /package/{agentic-flow/scripts → scripts}/test-fastmcp-docker.sh +0 -0
- /package/{agentic-flow/scripts → scripts}/test-fastmcp-poc.sh +0 -0
- /package/{agentic-flow/scripts → scripts}/test-functionality.sh +0 -0
- /package/{agentic-flow/scripts → scripts}/test-onnx-docker.sh +0 -0
- /package/{agentic-flow/scripts → scripts}/test-router-docker.sh +0 -0
- /package/{agentic-flow/scripts → scripts}/validate-mcp-cli-tools.sh +0 -0
- /package/{agentic-flow/scripts → scripts}/validate-providers.sh +0 -0
- /package/{agentic-flow/wasm → wasm}/quic/README.md +0 -0
- /package/{agentic-flow/wasm → wasm}/quic/agentic_flow_quic.js +0 -0
- /package/{agentic-flow/wasm → wasm}/quic/agentic_flow_quic_bg.wasm +0 -0
- /package/{agentic-flow/wasm → wasm}/quic/package.json +0 -0
- /package/{agentic-flow/wasm → wasm}/reasoningbank/package.json +0 -0
- /package/{agentic-flow/wasm → wasm}/reasoningbank/reasoningbank_wasm.js +0 -0
- /package/{agentic-flow/wasm → wasm}/reasoningbank/reasoningbank_wasm_bg.js +0 -0
- /package/{agentic-flow/wasm → wasm}/reasoningbank/reasoningbank_wasm_bg.wasm +0 -0
|
@@ -1,2964 +0,0 @@
|
|
|
1
|
-
# CRISPR-Cas13 Pipeline - System Architecture
|
|
2
|
-
|
|
3
|
-
## Executive Summary
|
|
4
|
-
|
|
5
|
-
This document describes the complete microservices architecture for the CRISPR-Cas13 bioinformatics pipeline, designed to analyze off-target effects and immune responses from non-human primate gene editing experiments.
|
|
6
|
-
|
|
7
|
-
**Architecture Principles:**
|
|
8
|
-
- **Scalability**: Horizontal scaling with Kubernetes orchestration
|
|
9
|
-
- **Fault Tolerance**: Circuit breakers, retry policies, graceful degradation
|
|
10
|
-
- **Security**: Zero-trust architecture with OAuth2/JWT authentication
|
|
11
|
-
- **Maintainability**: Clean separation of concerns, comprehensive monitoring
|
|
12
|
-
- **Performance**: Distributed processing with Apache Kafka, Redis caching
|
|
13
|
-
|
|
14
|
-
## Table of Contents
|
|
15
|
-
|
|
16
|
-
1. [System Context](#1-system-context)
|
|
17
|
-
2. [Container Architecture](#2-container-architecture)
|
|
18
|
-
3. [Data Layer](#3-data-layer)
|
|
19
|
-
4. [Processing Layer](#4-processing-layer)
|
|
20
|
-
5. [API Layer](#5-api-layer)
|
|
21
|
-
6. [UI Layer](#6-ui-layer)
|
|
22
|
-
7. [Security & Authentication](#7-security--authentication)
|
|
23
|
-
8. [Monitoring & Observability](#8-monitoring--observability)
|
|
24
|
-
9. [Deployment Strategy](#9-deployment-strategy)
|
|
25
|
-
10. [Technology Stack](#10-technology-stack)
|
|
26
|
-
11. [Scalability & Performance](#11-scalability--performance)
|
|
27
|
-
12. [Trade-off Analysis](#12-trade-off-analysis)
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## 1. System Context
|
|
32
|
-
|
|
33
|
-
### C4 Context Diagram
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
┌─────────────────────────────────────────────────────────────────────┐
|
|
37
|
-
│ External Systems │
|
|
38
|
-
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
|
|
39
|
-
│ │ Research │ │ NCBI │ │ Ensembl │ │
|
|
40
|
-
│ │ Team │ │ Database │ │ Genome │ │
|
|
41
|
-
│ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │
|
|
42
|
-
│ │ │ │ │
|
|
43
|
-
└─────────┼──────────────────┼──────────────────┼──────────────────────┘
|
|
44
|
-
│ │ │
|
|
45
|
-
▼ ▼ ▼
|
|
46
|
-
┌─────────────────────────────────────────────────────────────────────┐
|
|
47
|
-
│ CRISPR-Cas13 Analysis Pipeline │
|
|
48
|
-
│ │
|
|
49
|
-
│ ┌─────────────────────────────────────────────────────────────┐ │
|
|
50
|
-
│ │ Web Application │ │
|
|
51
|
-
│ │ (Experiment Setup, Monitoring, Visualization) │ │
|
|
52
|
-
│ └─────────────────────────────────────────────────────────────┘ │
|
|
53
|
-
│ │ │
|
|
54
|
-
│ ┌─────────────────────────────────────────────────────────────┐ │
|
|
55
|
-
│ │ API Gateway (Axum) │ │
|
|
56
|
-
│ │ (Authentication, Rate Limiting, Routing) │ │
|
|
57
|
-
│ └─────────────────────────────────────────────────────────────┘ │
|
|
58
|
-
│ │ │
|
|
59
|
-
│ ┌───────────────────┬──────┴───────┬──────────────────────────┐ │
|
|
60
|
-
│ │ │ │ │ │
|
|
61
|
-
│ ▼ ▼ ▼ ▼ │
|
|
62
|
-
│ ┌────────┐ ┌──────────┐ ┌──────────┐ ┌─────────┐ │
|
|
63
|
-
│ │Alignment│ │Off-Target│ │ Diff │ │ Data │ │
|
|
64
|
-
│ │ Service │ │ Predict │ │ Expr │ │ Storage │ │
|
|
65
|
-
│ │(Bowtie2)│ │ Service │ │ (DESeq2) │ │ │ │
|
|
66
|
-
│ └────────┘ └──────────┘ └──────────┘ └─────────┘ │
|
|
67
|
-
│ │
|
|
68
|
-
└───────────────────────────────────────────────────────────────────────┘
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### System Users
|
|
72
|
-
|
|
73
|
-
1. **Research Scientists**: Design experiments, submit samples, analyze results
|
|
74
|
-
2. **Bioinformaticians**: Configure pipelines, validate results, export data
|
|
75
|
-
3. **System Administrators**: Monitor health, manage resources, configure deployments
|
|
76
|
-
4. **External Systems**: NCBI (reference genomes), Ensembl (annotations), institutional HPC clusters
|
|
77
|
-
|
|
78
|
-
### Key Requirements
|
|
79
|
-
|
|
80
|
-
- **Throughput**: Process 50-100 samples/day (200GB-1TB sequencing data)
|
|
81
|
-
- **Latency**: Real-time status updates (<1s), full pipeline completion (2-6 hours)
|
|
82
|
-
- **Availability**: 99.9% uptime during business hours
|
|
83
|
-
- **Security**: HIPAA-compliant data handling, role-based access control
|
|
84
|
-
- **Scalability**: Auto-scale processing nodes 1-50 based on queue depth
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## 2. Container Architecture
|
|
89
|
-
|
|
90
|
-
### C4 Container Diagram
|
|
91
|
-
|
|
92
|
-
```mermaid
|
|
93
|
-
graph TB
|
|
94
|
-
subgraph "Client Layer"
|
|
95
|
-
WEB[React SPA<br/>TypeScript + Vite]
|
|
96
|
-
CLI[CLI Tool<br/>Python/Rust]
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
subgraph "API Gateway Layer"
|
|
100
|
-
NGINX[Nginx Ingress<br/>Load Balancer]
|
|
101
|
-
API[Axum API Server<br/>Rust + Tower]
|
|
102
|
-
WS[WebSocket Server<br/>Real-time Updates]
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
subgraph "Processing Layer - Kubernetes"
|
|
106
|
-
ALIGN[Alignment Service<br/>Bowtie2 + Samtools]
|
|
107
|
-
OFFTARGET[Off-Target Predictor<br/>Custom ML Model]
|
|
108
|
-
DIFFEXPR[Differential Expression<br/>DESeq2/EdgeR]
|
|
109
|
-
IMMUNE[Immune Response Analyzer<br/>ImmuneSigDB]
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
subgraph "Message Queue"
|
|
113
|
-
KAFKA[Apache Kafka<br/>Job Orchestration]
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
subgraph "Data Layer"
|
|
117
|
-
POSTGRES[(PostgreSQL<br/>Metadata + Results)]
|
|
118
|
-
MONGO[(MongoDB<br/>Genomic Annotations)]
|
|
119
|
-
REDIS[(Redis<br/>Cache + Sessions)]
|
|
120
|
-
MINIO[(MinIO S3<br/>FASTQ + BAM Files)]
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
subgraph "Monitoring Layer"
|
|
124
|
-
PROM[Prometheus<br/>Metrics Collection]
|
|
125
|
-
GRAFANA[Grafana<br/>Dashboards]
|
|
126
|
-
JAEGER[Jaeger<br/>Distributed Tracing]
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
WEB --> NGINX
|
|
130
|
-
CLI --> NGINX
|
|
131
|
-
NGINX --> API
|
|
132
|
-
NGINX --> WS
|
|
133
|
-
|
|
134
|
-
API --> KAFKA
|
|
135
|
-
API --> POSTGRES
|
|
136
|
-
API --> REDIS
|
|
137
|
-
|
|
138
|
-
KAFKA --> ALIGN
|
|
139
|
-
KAFKA --> OFFTARGET
|
|
140
|
-
KAFKA --> DIFFEXPR
|
|
141
|
-
KAFKA --> IMMUNE
|
|
142
|
-
|
|
143
|
-
ALIGN --> MINIO
|
|
144
|
-
ALIGN --> POSTGRES
|
|
145
|
-
OFFTARGET --> MONGO
|
|
146
|
-
DIFFEXPR --> POSTGRES
|
|
147
|
-
IMMUNE --> MONGO
|
|
148
|
-
|
|
149
|
-
API --> PROM
|
|
150
|
-
ALIGN --> PROM
|
|
151
|
-
OFFTARGET --> PROM
|
|
152
|
-
DIFFEXPR --> PROM
|
|
153
|
-
|
|
154
|
-
PROM --> GRAFANA
|
|
155
|
-
API --> JAEGER
|
|
156
|
-
ALIGN --> JAEGER
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### Container Communication Patterns
|
|
160
|
-
|
|
161
|
-
| Source → Target | Protocol | Purpose | Security |
|
|
162
|
-
|----------------|----------|---------|----------|
|
|
163
|
-
| Web → API Gateway | HTTPS (TLS 1.3) | REST API calls | JWT Bearer Token |
|
|
164
|
-
| API Gateway → Services | HTTP/2 + gRPC | Service mesh | mTLS |
|
|
165
|
-
| Services → Kafka | TCP (SASL/SSL) | Job submission | API Key |
|
|
166
|
-
| Services → Databases | TCP (TLS) | Data persistence | Role-based credentials |
|
|
167
|
-
| Services → MinIO | HTTPS | Object storage | IAM access keys |
|
|
168
|
-
| Prometheus → Services | HTTP | Metrics scraping | Service account |
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## 3. Data Layer
|
|
173
|
-
|
|
174
|
-
### 3.1 PostgreSQL - Relational Data
|
|
175
|
-
|
|
176
|
-
**Purpose**: Store structured metadata, experimental designs, analysis results, user accounts
|
|
177
|
-
|
|
178
|
-
**Schema Design**:
|
|
179
|
-
|
|
180
|
-
```sql
|
|
181
|
-
-- Database: crispr_cas13_pipeline
|
|
182
|
-
|
|
183
|
-
-- Users and Authentication
|
|
184
|
-
CREATE TABLE users (
|
|
185
|
-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
186
|
-
email VARCHAR(255) UNIQUE NOT NULL,
|
|
187
|
-
full_name VARCHAR(255) NOT NULL,
|
|
188
|
-
password_hash VARCHAR(255) NOT NULL,
|
|
189
|
-
role VARCHAR(50) NOT NULL DEFAULT 'researcher', -- researcher, bioinformatician, admin
|
|
190
|
-
institution VARCHAR(255),
|
|
191
|
-
created_at TIMESTAMPTZ DEFAULT NOW(),
|
|
192
|
-
updated_at TIMESTAMPTZ DEFAULT NOW(),
|
|
193
|
-
|
|
194
|
-
INDEX idx_email (email),
|
|
195
|
-
INDEX idx_role (role)
|
|
196
|
-
);
|
|
197
|
-
|
|
198
|
-
-- Experiments
|
|
199
|
-
CREATE TABLE experiments (
|
|
200
|
-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
201
|
-
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
202
|
-
name VARCHAR(255) NOT NULL,
|
|
203
|
-
description TEXT,
|
|
204
|
-
organism VARCHAR(100) DEFAULT 'Macaca mulatta', -- rhesus macaque
|
|
205
|
-
target_gene VARCHAR(100),
|
|
206
|
-
cas13_variant VARCHAR(50), -- Cas13a, Cas13b, Cas13d
|
|
207
|
-
guide_rna_sequence TEXT NOT NULL,
|
|
208
|
-
status VARCHAR(50) DEFAULT 'pending', -- pending, processing, completed, failed
|
|
209
|
-
created_at TIMESTAMPTZ DEFAULT NOW(),
|
|
210
|
-
completed_at TIMESTAMPTZ,
|
|
211
|
-
|
|
212
|
-
INDEX idx_user_id (user_id),
|
|
213
|
-
INDEX idx_status (status),
|
|
214
|
-
INDEX idx_created_at (created_at)
|
|
215
|
-
);
|
|
216
|
-
|
|
217
|
-
-- Samples
|
|
218
|
-
CREATE TABLE samples (
|
|
219
|
-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
220
|
-
experiment_id UUID NOT NULL REFERENCES experiments(id) ON DELETE CASCADE,
|
|
221
|
-
sample_name VARCHAR(255) NOT NULL,
|
|
222
|
-
sample_type VARCHAR(50), -- control, treatment, timepoint_0h, timepoint_24h
|
|
223
|
-
fastq_r1_path TEXT NOT NULL,
|
|
224
|
-
fastq_r2_path TEXT,
|
|
225
|
-
sequencing_platform VARCHAR(100), -- Illumina NovaSeq 6000
|
|
226
|
-
read_count BIGINT,
|
|
227
|
-
quality_score FLOAT,
|
|
228
|
-
created_at TIMESTAMPTZ DEFAULT NOW(),
|
|
229
|
-
|
|
230
|
-
INDEX idx_experiment_id (experiment_id),
|
|
231
|
-
INDEX idx_sample_type (sample_type),
|
|
232
|
-
UNIQUE (experiment_id, sample_name)
|
|
233
|
-
);
|
|
234
|
-
|
|
235
|
-
-- Analysis Jobs
|
|
236
|
-
CREATE TABLE analysis_jobs (
|
|
237
|
-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
238
|
-
experiment_id UUID NOT NULL REFERENCES experiments(id) ON DELETE CASCADE,
|
|
239
|
-
job_type VARCHAR(50) NOT NULL, -- alignment, off_target, diff_expr, immune_response
|
|
240
|
-
status VARCHAR(50) DEFAULT 'queued', -- queued, running, completed, failed
|
|
241
|
-
priority INT DEFAULT 5, -- 1-10
|
|
242
|
-
worker_pod VARCHAR(255), -- Kubernetes pod name
|
|
243
|
-
started_at TIMESTAMPTZ,
|
|
244
|
-
completed_at TIMESTAMPTZ,
|
|
245
|
-
error_message TEXT,
|
|
246
|
-
metrics JSONB, -- execution time, memory usage, etc.
|
|
247
|
-
|
|
248
|
-
INDEX idx_experiment_id (experiment_id),
|
|
249
|
-
INDEX idx_status (status),
|
|
250
|
-
INDEX idx_priority (priority),
|
|
251
|
-
INDEX idx_created_at (created_at)
|
|
252
|
-
);
|
|
253
|
-
|
|
254
|
-
-- Off-Target Predictions
|
|
255
|
-
CREATE TABLE off_targets (
|
|
256
|
-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
257
|
-
job_id UUID NOT NULL REFERENCES analysis_jobs(id) ON DELETE CASCADE,
|
|
258
|
-
chromosome VARCHAR(50) NOT NULL,
|
|
259
|
-
position BIGINT NOT NULL,
|
|
260
|
-
strand CHAR(1) CHECK (strand IN ('+', '-')),
|
|
261
|
-
target_sequence TEXT NOT NULL,
|
|
262
|
-
mismatch_count INT NOT NULL,
|
|
263
|
-
cfd_score FLOAT, -- Cutting Frequency Determination score
|
|
264
|
-
mit_score FLOAT, -- MIT specificity score
|
|
265
|
-
gene_symbol VARCHAR(100),
|
|
266
|
-
annotation TEXT,
|
|
267
|
-
|
|
268
|
-
INDEX idx_job_id (job_id),
|
|
269
|
-
INDEX idx_chromosome (chromosome),
|
|
270
|
-
INDEX idx_mismatch_count (mismatch_count),
|
|
271
|
-
INDEX idx_cfd_score (cfd_score)
|
|
272
|
-
);
|
|
273
|
-
|
|
274
|
-
-- Differential Expression Results
|
|
275
|
-
CREATE TABLE differential_expression (
|
|
276
|
-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
277
|
-
job_id UUID NOT NULL REFERENCES analysis_jobs(id) ON DELETE CASCADE,
|
|
278
|
-
gene_id VARCHAR(100) NOT NULL, -- Ensembl ID
|
|
279
|
-
gene_symbol VARCHAR(100),
|
|
280
|
-
base_mean FLOAT,
|
|
281
|
-
log2_fold_change FLOAT NOT NULL,
|
|
282
|
-
lfcse FLOAT, -- log2 fold change standard error
|
|
283
|
-
pvalue FLOAT NOT NULL,
|
|
284
|
-
padj FLOAT, -- adjusted p-value (Benjamini-Hochberg)
|
|
285
|
-
significant BOOLEAN GENERATED ALWAYS AS (padj < 0.05) STORED,
|
|
286
|
-
|
|
287
|
-
INDEX idx_job_id (job_id),
|
|
288
|
-
INDEX idx_gene_symbol (gene_symbol),
|
|
289
|
-
INDEX idx_padj (padj),
|
|
290
|
-
INDEX idx_significant (significant)
|
|
291
|
-
);
|
|
292
|
-
|
|
293
|
-
-- Immune Response Signatures
|
|
294
|
-
CREATE TABLE immune_signatures (
|
|
295
|
-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
296
|
-
job_id UUID NOT NULL REFERENCES analysis_jobs(id) ON DELETE CASCADE,
|
|
297
|
-
signature_name VARCHAR(255) NOT NULL, -- e.g., "Interferon Response"
|
|
298
|
-
signature_source VARCHAR(100), -- ImmuneSigDB, MSigDB
|
|
299
|
-
enrichment_score FLOAT NOT NULL,
|
|
300
|
-
normalized_enrichment_score FLOAT,
|
|
301
|
-
pvalue FLOAT NOT NULL,
|
|
302
|
-
fdr FLOAT, -- false discovery rate
|
|
303
|
-
leading_edge_genes TEXT[], -- array of gene symbols
|
|
304
|
-
|
|
305
|
-
INDEX idx_job_id (job_id),
|
|
306
|
-
INDEX idx_signature_name (signature_name),
|
|
307
|
-
INDEX idx_fdr (fdr)
|
|
308
|
-
);
|
|
309
|
-
|
|
310
|
-
-- Audit Log
|
|
311
|
-
CREATE TABLE audit_log (
|
|
312
|
-
id BIGSERIAL PRIMARY KEY,
|
|
313
|
-
user_id UUID REFERENCES users(id) ON DELETE SET NULL,
|
|
314
|
-
action VARCHAR(100) NOT NULL, -- login, create_experiment, submit_job, download_results
|
|
315
|
-
resource_type VARCHAR(100),
|
|
316
|
-
resource_id UUID,
|
|
317
|
-
ip_address INET,
|
|
318
|
-
user_agent TEXT,
|
|
319
|
-
metadata JSONB,
|
|
320
|
-
created_at TIMESTAMPTZ DEFAULT NOW(),
|
|
321
|
-
|
|
322
|
-
INDEX idx_user_id (user_id),
|
|
323
|
-
INDEX idx_action (action),
|
|
324
|
-
INDEX idx_created_at (created_at)
|
|
325
|
-
) PARTITION BY RANGE (created_at);
|
|
326
|
-
|
|
327
|
-
-- Create monthly partitions for audit log
|
|
328
|
-
CREATE TABLE audit_log_2025_01 PARTITION OF audit_log
|
|
329
|
-
FOR VALUES FROM ('2025-01-01') TO ('2025-02-01');
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
**Connection Pooling** (via `sqlx` in Rust):
|
|
333
|
-
```toml
|
|
334
|
-
[database]
|
|
335
|
-
max_connections = 100
|
|
336
|
-
min_connections = 10
|
|
337
|
-
connection_timeout = 30s
|
|
338
|
-
idle_timeout = 10m
|
|
339
|
-
max_lifetime = 30m
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
**Migration Strategy**:
|
|
343
|
-
- Use `sqlx-cli` for schema migrations
|
|
344
|
-
- Versioned migrations in `migrations/` directory
|
|
345
|
-
- Blue-green deployment for zero-downtime updates
|
|
346
|
-
- Automated rollback on migration failure
|
|
347
|
-
|
|
348
|
-
---
|
|
349
|
-
|
|
350
|
-
### 3.2 MongoDB - Genomic Annotations
|
|
351
|
-
|
|
352
|
-
**Purpose**: Store flexible, document-based genomic annotations, gene ontology terms, and analysis metadata
|
|
353
|
-
|
|
354
|
-
**Collections**:
|
|
355
|
-
|
|
356
|
-
1. **genes** - Gene annotations from Ensembl
|
|
357
|
-
2. **transcripts** - Transcript variants
|
|
358
|
-
3. **immune_signatures** - ImmuneSigDB reference data
|
|
359
|
-
4. **go_terms** - Gene Ontology annotations
|
|
360
|
-
5. **analysis_cache** - Cached intermediate results
|
|
361
|
-
|
|
362
|
-
**Example Document** (genes collection):
|
|
363
|
-
|
|
364
|
-
```json
|
|
365
|
-
{
|
|
366
|
-
"_id": ObjectId("..."),
|
|
367
|
-
"ensembl_id": "ENSMMUG00000012345",
|
|
368
|
-
"gene_symbol": "IFNB1",
|
|
369
|
-
"description": "interferon beta 1",
|
|
370
|
-
"chromosome": "chr9",
|
|
371
|
-
"start": 21077035,
|
|
372
|
-
"end": 21078018,
|
|
373
|
-
"strand": "+",
|
|
374
|
-
"biotype": "protein_coding",
|
|
375
|
-
"species": "Macaca_mulatta",
|
|
376
|
-
"transcripts": [
|
|
377
|
-
{
|
|
378
|
-
"transcript_id": "ENSMMUT00000012345",
|
|
379
|
-
"biotype": "protein_coding",
|
|
380
|
-
"length": 1783,
|
|
381
|
-
"exons": [
|
|
382
|
-
{"start": 21077035, "end": 21077248, "number": 1},
|
|
383
|
-
{"start": 21077790, "end": 21078018, "number": 2}
|
|
384
|
-
]
|
|
385
|
-
}
|
|
386
|
-
],
|
|
387
|
-
"go_terms": [
|
|
388
|
-
{"id": "GO:0051607", "term": "defense response to virus", "evidence": "IDA"},
|
|
389
|
-
{"id": "GO:0045071", "term": "negative regulation of viral genome replication", "evidence": "IMP"}
|
|
390
|
-
],
|
|
391
|
-
"orthologs": {
|
|
392
|
-
"human": "ENSG00000171855",
|
|
393
|
-
"mouse": "ENSMUSG00000048806"
|
|
394
|
-
},
|
|
395
|
-
"indexed_at": ISODate("2025-01-15T10:30:00Z")
|
|
396
|
-
}
|
|
397
|
-
```
|
|
398
|
-
|
|
399
|
-
**Sharding Strategy**:
|
|
400
|
-
- **Shard Key**: `chromosome` (distributes data evenly across 24 shards: chr1-chr22, chrX, chrY)
|
|
401
|
-
- **Config**: 3 replica sets × 3 shards = 9 nodes minimum
|
|
402
|
-
- **Indexes**:
|
|
403
|
-
- `{gene_symbol: 1}` - Fast gene lookups
|
|
404
|
-
- `{chromosome: 1, start: 1, end: 1}` - Range queries for genomic regions
|
|
405
|
-
- `{go_terms.id: 1}` - Gene Ontology searches
|
|
406
|
-
|
|
407
|
-
---
|
|
408
|
-
|
|
409
|
-
### 3.3 Redis - Caching & Job Queues
|
|
410
|
-
|
|
411
|
-
**Purpose**: High-performance caching, session management, real-time job status
|
|
412
|
-
|
|
413
|
-
**Use Cases**:
|
|
414
|
-
|
|
415
|
-
1. **Session Storage** (TTL: 24 hours)
|
|
416
|
-
```redis
|
|
417
|
-
SET session:a1b2c3d4 "{\"user_id\": \"uuid\", \"role\": \"researcher\"}" EX 86400
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
2. **Job Status Cache** (TTL: 1 hour after completion)
|
|
421
|
-
```redis
|
|
422
|
-
HSET job:uuid status "running"
|
|
423
|
-
HSET job:uuid progress "45.2"
|
|
424
|
-
HSET job:uuid worker_pod "align-worker-7f8d9"
|
|
425
|
-
EXPIRE job:uuid 3600
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
3. **API Rate Limiting** (sliding window)
|
|
429
|
-
```redis
|
|
430
|
-
ZADD rate_limit:user:uuid timestamp1 timestamp2 timestamp3
|
|
431
|
-
ZREMRANGEBYSCORE rate_limit:user:uuid 0 (timestamp-3600)
|
|
432
|
-
ZCARD rate_limit:user:uuid # count requests in last hour
|
|
433
|
-
```
|
|
434
|
-
|
|
435
|
-
4. **Cached Query Results** (TTL: 10 minutes)
|
|
436
|
-
```redis
|
|
437
|
-
SET cache:experiments:user:uuid "[{...}, {...}]" EX 600
|
|
438
|
-
```
|
|
439
|
-
|
|
440
|
-
**Cluster Configuration**:
|
|
441
|
-
- **Mode**: Redis Cluster (6 nodes: 3 masters + 3 replicas)
|
|
442
|
-
- **Persistence**: AOF (Append-Only File) + RDB snapshots every 5 minutes
|
|
443
|
-
- **Eviction Policy**: `allkeys-lru` (least recently used)
|
|
444
|
-
- **Max Memory**: 16GB per node
|
|
445
|
-
|
|
446
|
-
---
|
|
447
|
-
|
|
448
|
-
### 3.4 MinIO (S3-Compatible Object Storage)
|
|
449
|
-
|
|
450
|
-
**Purpose**: Store large sequencing files (FASTQ, BAM, VCF) and analysis artifacts
|
|
451
|
-
|
|
452
|
-
**Bucket Structure**:
|
|
453
|
-
|
|
454
|
-
```
|
|
455
|
-
crispr-cas13/
|
|
456
|
-
├── raw-data/
|
|
457
|
-
│ ├── {experiment_id}/
|
|
458
|
-
│ │ ├── {sample_id}_R1.fastq.gz
|
|
459
|
-
│ │ └── {sample_id}_R2.fastq.gz
|
|
460
|
-
├── aligned/
|
|
461
|
-
│ ├── {experiment_id}/
|
|
462
|
-
│ │ ├── {sample_id}.bam
|
|
463
|
-
│ │ └── {sample_id}.bam.bai
|
|
464
|
-
├── results/
|
|
465
|
-
│ ├── {job_id}/
|
|
466
|
-
│ │ ├── off_targets.csv
|
|
467
|
-
│ │ ├── diff_expr.csv
|
|
468
|
-
│ │ └── immune_signatures.json
|
|
469
|
-
└── reports/
|
|
470
|
-
└── {experiment_id}/
|
|
471
|
-
├── qc_report.html
|
|
472
|
-
└── final_report.pdf
|
|
473
|
-
```
|
|
474
|
-
|
|
475
|
-
**Lifecycle Policies**:
|
|
476
|
-
- **raw-data**: Retain for 180 days, then transition to Glacier
|
|
477
|
-
- **aligned**: Retain for 90 days, then delete (can regenerate)
|
|
478
|
-
- **results**: Retain indefinitely
|
|
479
|
-
- **reports**: Retain for 365 days
|
|
480
|
-
|
|
481
|
-
**Data Integrity**:
|
|
482
|
-
- MD5 checksums for all uploads
|
|
483
|
-
- Versioning enabled on all buckets
|
|
484
|
-
- Replication to secondary datacenter (disaster recovery)
|
|
485
|
-
|
|
486
|
-
**Access Control**:
|
|
487
|
-
- IAM policies per service (principle of least privilege)
|
|
488
|
-
- Pre-signed URLs for temporary file access (TTL: 1 hour)
|
|
489
|
-
- Server-side encryption (SSE-S3) for all objects
|
|
490
|
-
|
|
491
|
-
---
|
|
492
|
-
|
|
493
|
-
## 4. Processing Layer
|
|
494
|
-
|
|
495
|
-
### 4.1 Kubernetes Cluster Architecture
|
|
496
|
-
|
|
497
|
-
**Cluster Specifications**:
|
|
498
|
-
- **Nodes**: 10-50 worker nodes (auto-scaling)
|
|
499
|
-
- **CPU-optimized**: 16 vCPU, 32GB RAM (alignment, off-target prediction)
|
|
500
|
-
- **Memory-optimized**: 8 vCPU, 64GB RAM (differential expression, R/Bioconductor)
|
|
501
|
-
- **Namespaces**:
|
|
502
|
-
- `crispr-production` - Production workloads
|
|
503
|
-
- `crispr-staging` - Pre-production testing
|
|
504
|
-
- `crispr-dev` - Development experiments
|
|
505
|
-
- `monitoring` - Prometheus, Grafana, Jaeger
|
|
506
|
-
- `kafka` - Message queue infrastructure
|
|
507
|
-
|
|
508
|
-
**Node Affinity Labels**:
|
|
509
|
-
```yaml
|
|
510
|
-
node-role: compute-intensive # for alignment, off-target prediction
|
|
511
|
-
node-role: memory-intensive # for DESeq2, R workloads
|
|
512
|
-
node-role: gpu-enabled # future ML model inference
|
|
513
|
-
```
|
|
514
|
-
|
|
515
|
-
---
|
|
516
|
-
|
|
517
|
-
### 4.2 Microservice Containers
|
|
518
|
-
|
|
519
|
-
#### 4.2.1 Alignment Service (Bowtie2)
|
|
520
|
-
|
|
521
|
-
**Responsibilities**:
|
|
522
|
-
- Align FASTQ reads to reference genome
|
|
523
|
-
- Quality control (FastQC, MultiQC)
|
|
524
|
-
- BAM sorting and indexing (Samtools)
|
|
525
|
-
|
|
526
|
-
**Technology Stack**:
|
|
527
|
-
- **Base Image**: `ubuntu:22.04` with Bioconda
|
|
528
|
-
- **Tools**: Bowtie2 2.5.1, Samtools 1.17, FastQC 0.12.1
|
|
529
|
-
- **Language**: Python 3.11 (orchestration scripts)
|
|
530
|
-
|
|
531
|
-
**Resource Limits**:
|
|
532
|
-
```yaml
|
|
533
|
-
resources:
|
|
534
|
-
requests:
|
|
535
|
-
cpu: "4"
|
|
536
|
-
memory: "16Gi"
|
|
537
|
-
limits:
|
|
538
|
-
cpu: "8"
|
|
539
|
-
memory: "32Gi"
|
|
540
|
-
```
|
|
541
|
-
|
|
542
|
-
**Dockerfile** (see `docker/alignment-service/Dockerfile`):
|
|
543
|
-
```dockerfile
|
|
544
|
-
FROM ubuntu:22.04
|
|
545
|
-
|
|
546
|
-
# Install Bioconda and tools
|
|
547
|
-
RUN apt-get update && apt-get install -y \
|
|
548
|
-
wget curl git build-essential python3.11 python3-pip
|
|
549
|
-
|
|
550
|
-
# Install Miniconda
|
|
551
|
-
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
|
|
552
|
-
bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda && \
|
|
553
|
-
rm Miniconda3-latest-Linux-x86_64.sh
|
|
554
|
-
|
|
555
|
-
ENV PATH="/opt/conda/bin:$PATH"
|
|
556
|
-
|
|
557
|
-
# Install bioinformatics tools
|
|
558
|
-
RUN conda install -c bioconda bowtie2=2.5.1 samtools=1.17 fastqc=0.12.1 -y
|
|
559
|
-
|
|
560
|
-
# Install Python dependencies
|
|
561
|
-
COPY requirements.txt /app/
|
|
562
|
-
RUN pip3 install -r /app/requirements.txt
|
|
563
|
-
|
|
564
|
-
COPY alignment_worker.py /app/
|
|
565
|
-
WORKDIR /app
|
|
566
|
-
|
|
567
|
-
CMD ["python3", "alignment_worker.py"]
|
|
568
|
-
```
|
|
569
|
-
|
|
570
|
-
**Python Worker** (alignment_worker.py):
|
|
571
|
-
```python
|
|
572
|
-
import os
|
|
573
|
-
import subprocess
|
|
574
|
-
from kafka import KafkaConsumer, KafkaProducer
|
|
575
|
-
import boto3
|
|
576
|
-
import logging
|
|
577
|
-
|
|
578
|
-
logging.basicConfig(level=logging.INFO)
|
|
579
|
-
logger = logging.getLogger(__name__)
|
|
580
|
-
|
|
581
|
-
def align_sample(sample_id, fastq_r1_s3, fastq_r2_s3, reference_genome):
|
|
582
|
-
"""
|
|
583
|
-
Download FASTQ from MinIO, align with Bowtie2, upload BAM to MinIO
|
|
584
|
-
"""
|
|
585
|
-
s3 = boto3.client('s3', endpoint_url=os.getenv('MINIO_ENDPOINT'))
|
|
586
|
-
|
|
587
|
-
# Download FASTQ files
|
|
588
|
-
logger.info(f"Downloading {fastq_r1_s3} and {fastq_r2_s3}")
|
|
589
|
-
s3.download_file('crispr-cas13', fastq_r1_s3, f'/tmp/{sample_id}_R1.fastq.gz')
|
|
590
|
-
s3.download_file('crispr-cas13', fastq_r2_s3, f'/tmp/{sample_id}_R2.fastq.gz')
|
|
591
|
-
|
|
592
|
-
# Run Bowtie2 alignment
|
|
593
|
-
logger.info(f"Aligning sample {sample_id}")
|
|
594
|
-
cmd = [
|
|
595
|
-
'bowtie2',
|
|
596
|
-
'-x', reference_genome,
|
|
597
|
-
'-1', f'/tmp/{sample_id}_R1.fastq.gz',
|
|
598
|
-
'-2', f'/tmp/{sample_id}_R2.fastq.gz',
|
|
599
|
-
'-p', '8', # threads
|
|
600
|
-
'--very-sensitive',
|
|
601
|
-
'-S', f'/tmp/{sample_id}.sam'
|
|
602
|
-
]
|
|
603
|
-
subprocess.run(cmd, check=True)
|
|
604
|
-
|
|
605
|
-
# Convert SAM to BAM, sort, and index
|
|
606
|
-
logger.info("Converting SAM to BAM")
|
|
607
|
-
subprocess.run(['samtools', 'view', '-bS', f'/tmp/{sample_id}.sam', '-o', f'/tmp/{sample_id}.bam'], check=True)
|
|
608
|
-
subprocess.run(['samtools', 'sort', f'/tmp/{sample_id}.bam', '-o', f'/tmp/{sample_id}.sorted.bam'], check=True)
|
|
609
|
-
subprocess.run(['samtools', 'index', f'/tmp/{sample_id}.sorted.bam'], check=True)
|
|
610
|
-
|
|
611
|
-
# Upload BAM to MinIO
|
|
612
|
-
logger.info("Uploading BAM to MinIO")
|
|
613
|
-
s3.upload_file(f'/tmp/{sample_id}.sorted.bam', 'crispr-cas13', f'aligned/{sample_id}/{sample_id}.bam')
|
|
614
|
-
s3.upload_file(f'/tmp/{sample_id}.sorted.bam.bai', 'crispr-cas13', f'aligned/{sample_id}/{sample_id}.bam.bai')
|
|
615
|
-
|
|
616
|
-
# Cleanup
|
|
617
|
-
os.remove(f'/tmp/{sample_id}_R1.fastq.gz')
|
|
618
|
-
os.remove(f'/tmp/{sample_id}_R2.fastq.gz')
|
|
619
|
-
os.remove(f'/tmp/{sample_id}.sam')
|
|
620
|
-
os.remove(f'/tmp/{sample_id}.bam')
|
|
621
|
-
|
|
622
|
-
return f's3://crispr-cas13/aligned/{sample_id}/{sample_id}.bam'
|
|
623
|
-
|
|
624
|
-
def main():
|
|
625
|
-
consumer = KafkaConsumer(
|
|
626
|
-
'jobs.alignment',
|
|
627
|
-
bootstrap_servers=os.getenv('KAFKA_BROKERS'),
|
|
628
|
-
group_id='alignment-workers'
|
|
629
|
-
)
|
|
630
|
-
|
|
631
|
-
producer = KafkaProducer(bootstrap_servers=os.getenv('KAFKA_BROKERS'))
|
|
632
|
-
|
|
633
|
-
for message in consumer:
|
|
634
|
-
job = json.loads(message.value)
|
|
635
|
-
logger.info(f"Processing alignment job {job['job_id']}")
|
|
636
|
-
|
|
637
|
-
try:
|
|
638
|
-
bam_path = align_sample(
|
|
639
|
-
job['sample_id'],
|
|
640
|
-
job['fastq_r1_s3'],
|
|
641
|
-
job['fastq_r2_s3'],
|
|
642
|
-
job['reference_genome']
|
|
643
|
-
)
|
|
644
|
-
|
|
645
|
-
# Send completion message
|
|
646
|
-
producer.send('jobs.completed', json.dumps({
|
|
647
|
-
'job_id': job['job_id'],
|
|
648
|
-
'status': 'completed',
|
|
649
|
-
'bam_path': bam_path
|
|
650
|
-
}).encode())
|
|
651
|
-
|
|
652
|
-
except Exception as e:
|
|
653
|
-
logger.error(f"Alignment failed: {e}")
|
|
654
|
-
producer.send('jobs.failed', json.dumps({
|
|
655
|
-
'job_id': job['job_id'],
|
|
656
|
-
'error': str(e)
|
|
657
|
-
}).encode())
|
|
658
|
-
|
|
659
|
-
if __name__ == '__main__':
|
|
660
|
-
main()
|
|
661
|
-
```
|
|
662
|
-
|
|
663
|
-
---
|
|
664
|
-
|
|
665
|
-
#### 4.2.2 Off-Target Prediction Service
|
|
666
|
-
|
|
667
|
-
**Responsibilities**:
|
|
668
|
-
- Extract guide RNA sequences from BAM files
|
|
669
|
-
- Predict off-target sites using custom ML model
|
|
670
|
-
- Score off-targets with CFD and MIT algorithms
|
|
671
|
-
|
|
672
|
-
**Technology Stack**:
|
|
673
|
-
- **Base Image**: `python:3.11-slim`
|
|
674
|
-
- **ML Framework**: PyTorch 2.1 (pre-trained transformer model)
|
|
675
|
-
- **Libraries**: Biopython, NumPy, Pandas
|
|
676
|
-
|
|
677
|
-
**Resource Limits**:
|
|
678
|
-
```yaml
|
|
679
|
-
resources:
|
|
680
|
-
requests:
|
|
681
|
-
cpu: "2"
|
|
682
|
-
memory: "8Gi"
|
|
683
|
-
limits:
|
|
684
|
-
cpu: "4"
|
|
685
|
-
memory: "16Gi"
|
|
686
|
-
```
|
|
687
|
-
|
|
688
|
-
**Dockerfile** (see `docker/off-target-service/Dockerfile`):
|
|
689
|
-
```dockerfile
|
|
690
|
-
FROM python:3.11-slim
|
|
691
|
-
|
|
692
|
-
RUN apt-get update && apt-get install -y \
|
|
693
|
-
build-essential libssl-dev
|
|
694
|
-
|
|
695
|
-
COPY requirements.txt /app/
|
|
696
|
-
RUN pip install --no-cache-dir -r /app/requirements.txt
|
|
697
|
-
|
|
698
|
-
COPY off_target_worker.py /app/
|
|
699
|
-
COPY models/ /app/models/
|
|
700
|
-
|
|
701
|
-
WORKDIR /app
|
|
702
|
-
CMD ["python", "off_target_worker.py"]
|
|
703
|
-
```
|
|
704
|
-
|
|
705
|
-
**Python Worker** (off_target_worker.py):
|
|
706
|
-
```python
|
|
707
|
-
import torch
|
|
708
|
-
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
|
709
|
-
import pysam
|
|
710
|
-
from kafka import KafkaConsumer, KafkaProducer
|
|
711
|
-
import logging
|
|
712
|
-
|
|
713
|
-
logger = logging.getLogger(__name__)
|
|
714
|
-
|
|
715
|
-
class OffTargetPredictor:
|
|
716
|
-
def __init__(self, model_path='/app/models/cas13_off_target.pt'):
|
|
717
|
-
self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
718
|
-
self.model = AutoModelForSequenceClassification.from_pretrained(model_path).to(self.device)
|
|
719
|
-
self.tokenizer = AutoTokenizer.from_pretrained(model_path)
|
|
720
|
-
|
|
721
|
-
def predict_off_targets(self, guide_rna, bam_path, genome_fasta):
|
|
722
|
-
"""
|
|
723
|
-
Scan genome for potential off-target sites
|
|
724
|
-
"""
|
|
725
|
-
off_targets = []
|
|
726
|
-
|
|
727
|
-
# Open BAM file and extract aligned reads
|
|
728
|
-
bamfile = pysam.AlignmentFile(bam_path, "rb")
|
|
729
|
-
|
|
730
|
-
# Scan for sequences with mismatches to guide RNA
|
|
731
|
-
for read in bamfile.fetch():
|
|
732
|
-
if read.is_unmapped:
|
|
733
|
-
continue
|
|
734
|
-
|
|
735
|
-
seq = read.query_sequence
|
|
736
|
-
mismatches = self.count_mismatches(guide_rna, seq)
|
|
737
|
-
|
|
738
|
-
if 1 <= mismatches <= 4: # Potential off-target (1-4 mismatches)
|
|
739
|
-
# Score with ML model
|
|
740
|
-
cfd_score = self.calculate_cfd_score(guide_rna, seq)
|
|
741
|
-
mit_score = self.calculate_mit_score(guide_rna, seq)
|
|
742
|
-
|
|
743
|
-
off_targets.append({
|
|
744
|
-
'chromosome': bamfile.get_reference_name(read.reference_id),
|
|
745
|
-
'position': read.reference_start,
|
|
746
|
-
'strand': '+' if not read.is_reverse else '-',
|
|
747
|
-
'target_sequence': seq,
|
|
748
|
-
'mismatch_count': mismatches,
|
|
749
|
-
'cfd_score': cfd_score,
|
|
750
|
-
'mit_score': mit_score
|
|
751
|
-
})
|
|
752
|
-
|
|
753
|
-
bamfile.close()
|
|
754
|
-
return off_targets
|
|
755
|
-
|
|
756
|
-
def count_mismatches(self, seq1, seq2):
|
|
757
|
-
# Implementation details...
|
|
758
|
-
pass
|
|
759
|
-
|
|
760
|
-
def calculate_cfd_score(self, guide, target):
|
|
761
|
-
# Cutting Frequency Determination score
|
|
762
|
-
# Implementation based on Doench et al. 2016
|
|
763
|
-
pass
|
|
764
|
-
|
|
765
|
-
def calculate_mit_score(self, guide, target):
|
|
766
|
-
# MIT specificity score
|
|
767
|
-
# Implementation based on Hsu et al. 2013
|
|
768
|
-
pass
|
|
769
|
-
|
|
770
|
-
def main():
|
|
771
|
-
predictor = OffTargetPredictor()
|
|
772
|
-
|
|
773
|
-
consumer = KafkaConsumer(
|
|
774
|
-
'jobs.off_target',
|
|
775
|
-
bootstrap_servers=os.getenv('KAFKA_BROKERS'),
|
|
776
|
-
group_id='off-target-workers'
|
|
777
|
-
)
|
|
778
|
-
|
|
779
|
-
producer = KafkaProducer(bootstrap_servers=os.getenv('KAFKA_BROKERS'))
|
|
780
|
-
|
|
781
|
-
for message in consumer:
|
|
782
|
-
job = json.loads(message.value)
|
|
783
|
-
logger.info(f"Processing off-target job {job['job_id']}")
|
|
784
|
-
|
|
785
|
-
try:
|
|
786
|
-
off_targets = predictor.predict_off_targets(
|
|
787
|
-
job['guide_rna'],
|
|
788
|
-
job['bam_path'],
|
|
789
|
-
job['genome_fasta']
|
|
790
|
-
)
|
|
791
|
-
|
|
792
|
-
# Store in MongoDB and PostgreSQL
|
|
793
|
-
# ... (implementation)
|
|
794
|
-
|
|
795
|
-
producer.send('jobs.completed', json.dumps({
|
|
796
|
-
'job_id': job['job_id'],
|
|
797
|
-
'off_target_count': len(off_targets)
|
|
798
|
-
}).encode())
|
|
799
|
-
|
|
800
|
-
except Exception as e:
|
|
801
|
-
logger.error(f"Off-target prediction failed: {e}")
|
|
802
|
-
producer.send('jobs.failed', json.dumps({
|
|
803
|
-
'job_id': job['job_id'],
|
|
804
|
-
'error': str(e)
|
|
805
|
-
}).encode())
|
|
806
|
-
|
|
807
|
-
if __name__ == '__main__':
|
|
808
|
-
main()
|
|
809
|
-
```
|
|
810
|
-
|
|
811
|
-
---
|
|
812
|
-
|
|
813
|
-
#### 4.2.3 Differential Expression Service (DESeq2/EdgeR)
|
|
814
|
-
|
|
815
|
-
**Responsibilities**:
|
|
816
|
-
- Count gene expression from BAM files (featureCounts)
|
|
817
|
-
- Perform differential expression analysis (DESeq2 or EdgeR)
|
|
818
|
-
- Generate visualizations (MA plots, volcano plots, heatmaps)
|
|
819
|
-
|
|
820
|
-
**Technology Stack**:
|
|
821
|
-
- **Base Image**: `bioconductor/bioconductor_docker:RELEASE_3_18`
|
|
822
|
-
- **R Packages**: DESeq2 1.42, edgeR 3.44, ggplot2 3.4
|
|
823
|
-
- **Language**: R 4.3 with Rserve for API integration
|
|
824
|
-
|
|
825
|
-
**Resource Limits**:
|
|
826
|
-
```yaml
|
|
827
|
-
resources:
|
|
828
|
-
requests:
|
|
829
|
-
cpu: "4"
|
|
830
|
-
memory: "32Gi" # R requires significant memory
|
|
831
|
-
limits:
|
|
832
|
-
cpu: "8"
|
|
833
|
-
memory: "64Gi"
|
|
834
|
-
```
|
|
835
|
-
|
|
836
|
-
**Dockerfile** (see `docker/diff-expr-service/Dockerfile`):
|
|
837
|
-
```dockerfile
|
|
838
|
-
FROM bioconductor/bioconductor_docker:RELEASE_3_18
|
|
839
|
-
|
|
840
|
-
RUN R -e "BiocManager::install(c('DESeq2', 'edgeR', 'Rsubread', 'ggplot2', 'pheatmap', 'EnhancedVolcano'))"
|
|
841
|
-
|
|
842
|
-
COPY diff_expr_worker.R /app/
|
|
843
|
-
WORKDIR /app
|
|
844
|
-
|
|
845
|
-
CMD ["Rscript", "diff_expr_worker.R"]
|
|
846
|
-
```
|
|
847
|
-
|
|
848
|
-
**R Worker** (diff_expr_worker.R):
|
|
849
|
-
```r
|
|
850
|
-
library(DESeq2)
|
|
851
|
-
library(edgeR)
|
|
852
|
-
library(Rsubread)
|
|
853
|
-
library(ggplot2)
|
|
854
|
-
|
|
855
|
-
# Kafka consumer setup (using rkafka package)
|
|
856
|
-
library(rkafka)
|
|
857
|
-
|
|
858
|
-
consumer <- rkafka.createConsumer(
|
|
859
|
-
list("metadata.broker.list" = Sys.getenv("KAFKA_BROKERS"))
|
|
860
|
-
)
|
|
861
|
-
|
|
862
|
-
while (TRUE) {
|
|
863
|
-
message <- rkafka.consume(consumer, "jobs.diff_expr")
|
|
864
|
-
|
|
865
|
-
if (!is.null(message)) {
|
|
866
|
-
job <- jsonlite::fromJSON(message$payload)
|
|
867
|
-
|
|
868
|
-
tryCatch({
|
|
869
|
-
# Step 1: Count reads with featureCounts
|
|
870
|
-
bam_files <- job$bam_files
|
|
871
|
-
gtf_file <- job$gtf_annotation
|
|
872
|
-
|
|
873
|
-
counts <- featureCounts(
|
|
874
|
-
files = bam_files,
|
|
875
|
-
annot.ext = gtf_file,
|
|
876
|
-
isGTFAnnotationFile = TRUE,
|
|
877
|
-
GTF.featureType = "exon",
|
|
878
|
-
GTF.attrType = "gene_id",
|
|
879
|
-
nthreads = 8
|
|
880
|
-
)
|
|
881
|
-
|
|
882
|
-
# Step 2: Create DESeqDataSet
|
|
883
|
-
col_data <- data.frame(
|
|
884
|
-
condition = job$conditions, # e.g., c("control", "control", "treatment", "treatment")
|
|
885
|
-
row.names = job$sample_names
|
|
886
|
-
)
|
|
887
|
-
|
|
888
|
-
dds <- DESeqDataSetFromMatrix(
|
|
889
|
-
countData = counts$counts,
|
|
890
|
-
colData = col_data,
|
|
891
|
-
design = ~ condition
|
|
892
|
-
)
|
|
893
|
-
|
|
894
|
-
# Step 3: Run differential expression analysis
|
|
895
|
-
dds <- DESeq(dds)
|
|
896
|
-
res <- results(dds, contrast = c("condition", "treatment", "control"))
|
|
897
|
-
|
|
898
|
-
# Step 4: Extract significant genes
|
|
899
|
-
res_df <- as.data.frame(res)
|
|
900
|
-
res_df$gene_id <- rownames(res_df)
|
|
901
|
-
sig_genes <- res_df[res_df$padj < 0.05 & !is.na(res_df$padj), ]
|
|
902
|
-
|
|
903
|
-
# Step 5: Generate plots
|
|
904
|
-
pdf(paste0("/tmp/", job$job_id, "_plots.pdf"))
|
|
905
|
-
|
|
906
|
-
# MA plot
|
|
907
|
-
plotMA(res, main = "MA Plot")
|
|
908
|
-
|
|
909
|
-
# Volcano plot
|
|
910
|
-
EnhancedVolcano::EnhancedVolcano(
|
|
911
|
-
res_df,
|
|
912
|
-
lab = res_df$gene_id,
|
|
913
|
-
x = 'log2FoldChange',
|
|
914
|
-
y = 'padj'
|
|
915
|
-
)
|
|
916
|
-
|
|
917
|
-
# Heatmap of top 50 genes
|
|
918
|
-
top_genes <- head(sig_genes[order(sig_genes$padj), ], 50)
|
|
919
|
-
pheatmap::pheatmap(
|
|
920
|
-
assay(dds)[rownames(top_genes), ],
|
|
921
|
-
cluster_rows = TRUE,
|
|
922
|
-
cluster_cols = TRUE,
|
|
923
|
-
show_rownames = TRUE
|
|
924
|
-
)
|
|
925
|
-
|
|
926
|
-
dev.off()
|
|
927
|
-
|
|
928
|
-
# Step 6: Upload results to PostgreSQL and MinIO
|
|
929
|
-
# ... (implementation)
|
|
930
|
-
|
|
931
|
-
# Send completion message
|
|
932
|
-
rkafka.produce(
|
|
933
|
-
producer,
|
|
934
|
-
"jobs.completed",
|
|
935
|
-
jsonlite::toJSON(list(
|
|
936
|
-
job_id = job$job_id,
|
|
937
|
-
significant_genes = nrow(sig_genes)
|
|
938
|
-
))
|
|
939
|
-
)
|
|
940
|
-
|
|
941
|
-
}, error = function(e) {
|
|
942
|
-
rkafka.produce(
|
|
943
|
-
producer,
|
|
944
|
-
"jobs.failed",
|
|
945
|
-
jsonlite::toJSON(list(
|
|
946
|
-
job_id = job$job_id,
|
|
947
|
-
error = as.character(e)
|
|
948
|
-
))
|
|
949
|
-
)
|
|
950
|
-
})
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
Sys.sleep(5) # Poll every 5 seconds
|
|
954
|
-
}
|
|
955
|
-
```
|
|
956
|
-
|
|
957
|
-
---
|
|
958
|
-
|
|
959
|
-
### 4.3 Apache Kafka - Message Queue
|
|
960
|
-
|
|
961
|
-
**Purpose**: Decouple API layer from processing layer, enable fault-tolerant job orchestration
|
|
962
|
-
|
|
963
|
-
**Topics**:
|
|
964
|
-
|
|
965
|
-
| Topic | Partitions | Replication | Purpose |
|
|
966
|
-
|-------|------------|-------------|---------|
|
|
967
|
-
| `jobs.submitted` | 10 | 3 | New analysis jobs from API |
|
|
968
|
-
| `jobs.alignment` | 10 | 3 | Alignment tasks |
|
|
969
|
-
| `jobs.off_target` | 10 | 3 | Off-target prediction tasks |
|
|
970
|
-
| `jobs.diff_expr` | 5 | 3 | Differential expression tasks |
|
|
971
|
-
| `jobs.immune` | 5 | 3 | Immune response analysis tasks |
|
|
972
|
-
| `jobs.completed` | 10 | 3 | Successfully completed jobs |
|
|
973
|
-
| `jobs.failed` | 5 | 3 | Failed jobs for retry/alerting |
|
|
974
|
-
| `jobs.progress` | 10 | 3 | Real-time progress updates |
|
|
975
|
-
|
|
976
|
-
**Producer Configuration** (Rust API):
|
|
977
|
-
```rust
|
|
978
|
-
use rdkafka::producer::{FutureProducer, FutureRecord};
|
|
979
|
-
use rdkafka::config::ClientConfig;
|
|
980
|
-
|
|
981
|
-
let producer: FutureProducer = ClientConfig::new()
|
|
982
|
-
.set("bootstrap.servers", "kafka-broker-1:9092,kafka-broker-2:9092,kafka-broker-3:9092")
|
|
983
|
-
.set("message.timeout.ms", "5000")
|
|
984
|
-
.set("acks", "all") // Wait for all in-sync replicas
|
|
985
|
-
.set("retries", "3")
|
|
986
|
-
.create()
|
|
987
|
-
.expect("Producer creation error");
|
|
988
|
-
|
|
989
|
-
// Produce message
|
|
990
|
-
let payload = serde_json::to_string(&job)?;
|
|
991
|
-
producer
|
|
992
|
-
.send(
|
|
993
|
-
FutureRecord::to("jobs.alignment")
|
|
994
|
-
.payload(&payload)
|
|
995
|
-
.key(&job.job_id),
|
|
996
|
-
Duration::from_secs(0),
|
|
997
|
-
)
|
|
998
|
-
.await?;
|
|
999
|
-
```
|
|
1000
|
-
|
|
1001
|
-
**Consumer Configuration** (Python workers):
|
|
1002
|
-
```python
|
|
1003
|
-
from kafka import KafkaConsumer
|
|
1004
|
-
|
|
1005
|
-
consumer = KafkaConsumer(
|
|
1006
|
-
'jobs.alignment',
|
|
1007
|
-
bootstrap_servers=['kafka-broker-1:9092', 'kafka-broker-2:9092', 'kafka-broker-3:9092'],
|
|
1008
|
-
group_id='alignment-workers',
|
|
1009
|
-
auto_offset_reset='earliest',
|
|
1010
|
-
enable_auto_commit=True,
|
|
1011
|
-
max_poll_records=10,
|
|
1012
|
-
session_timeout_ms=30000,
|
|
1013
|
-
heartbeat_interval_ms=10000
|
|
1014
|
-
)
|
|
1015
|
-
```
|
|
1016
|
-
|
|
1017
|
-
**Monitoring**:
|
|
1018
|
-
- Consumer lag alerts (Prometheus + Grafana)
|
|
1019
|
-
- Throughput metrics (messages/sec per topic)
|
|
1020
|
-
- Partition rebalancing events
|
|
1021
|
-
|
|
1022
|
-
---
|
|
1023
|
-
|
|
1024
|
-
### 4.4 Horizontal Scaling Strategy
|
|
1025
|
-
|
|
1026
|
-
**Auto-Scaling Policies** (Kubernetes HPA):
|
|
1027
|
-
|
|
1028
|
-
```yaml
|
|
1029
|
-
apiVersion: autoscaling/v2
|
|
1030
|
-
kind: HorizontalPodAutoscaler
|
|
1031
|
-
metadata:
|
|
1032
|
-
name: alignment-service-hpa
|
|
1033
|
-
namespace: crispr-production
|
|
1034
|
-
spec:
|
|
1035
|
-
scaleTargetRef:
|
|
1036
|
-
apiVersion: apps/v1
|
|
1037
|
-
kind: Deployment
|
|
1038
|
-
name: alignment-service
|
|
1039
|
-
minReplicas: 2
|
|
1040
|
-
maxReplicas: 20
|
|
1041
|
-
metrics:
|
|
1042
|
-
- type: Resource
|
|
1043
|
-
resource:
|
|
1044
|
-
name: cpu
|
|
1045
|
-
target:
|
|
1046
|
-
type: Utilization
|
|
1047
|
-
averageUtilization: 70
|
|
1048
|
-
- type: Resource
|
|
1049
|
-
resource:
|
|
1050
|
-
name: memory
|
|
1051
|
-
target:
|
|
1052
|
-
type: Utilization
|
|
1053
|
-
averageUtilization: 80
|
|
1054
|
-
- type: External
|
|
1055
|
-
external:
|
|
1056
|
-
metric:
|
|
1057
|
-
name: kafka_consumer_lag
|
|
1058
|
-
selector:
|
|
1059
|
-
matchLabels:
|
|
1060
|
-
topic: jobs.alignment
|
|
1061
|
-
target:
|
|
1062
|
-
type: Value
|
|
1063
|
-
value: "100" # Scale up if lag > 100 messages
|
|
1064
|
-
behavior:
|
|
1065
|
-
scaleUp:
|
|
1066
|
-
stabilizationWindowSeconds: 60
|
|
1067
|
-
policies:
|
|
1068
|
-
- type: Percent
|
|
1069
|
-
value: 100 # Double pods
|
|
1070
|
-
periodSeconds: 60
|
|
1071
|
-
scaleDown:
|
|
1072
|
-
stabilizationWindowSeconds: 300
|
|
1073
|
-
policies:
|
|
1074
|
-
- type: Percent
|
|
1075
|
-
value: 50 # Reduce by half
|
|
1076
|
-
periodSeconds: 60
|
|
1077
|
-
```
|
|
1078
|
-
|
|
1079
|
-
---
|
|
1080
|
-
|
|
1081
|
-
## 5. API Layer
|
|
1082
|
-
|
|
1083
|
-
### 5.1 Axum (Rust) RESTful API
|
|
1084
|
-
|
|
1085
|
-
**Why Rust + Axum?**
|
|
1086
|
-
- **Performance**: ~10x faster than Node.js for I/O-bound operations
|
|
1087
|
-
- **Memory Safety**: No null pointers, data races, or buffer overflows
|
|
1088
|
-
- **Concurrency**: Tokio async runtime for efficient request handling
|
|
1089
|
-
- **Type Safety**: Compile-time guarantees for API contracts
|
|
1090
|
-
|
|
1091
|
-
**Project Structure**:
|
|
1092
|
-
```
|
|
1093
|
-
api/
|
|
1094
|
-
├── src/
|
|
1095
|
-
│ ├── main.rs # Entry point, server setup
|
|
1096
|
-
│ ├── routes/
|
|
1097
|
-
│ │ ├── mod.rs
|
|
1098
|
-
│ │ ├── auth.rs # POST /api/v1/auth/login, /logout
|
|
1099
|
-
│ │ ├── experiments.rs # CRUD for experiments
|
|
1100
|
-
│ │ ├── samples.rs # Upload FASTQ files
|
|
1101
|
-
│ │ ├── jobs.rs # Submit and monitor jobs
|
|
1102
|
-
│ │ └── results.rs # Query analysis results
|
|
1103
|
-
│ ├── models/
|
|
1104
|
-
│ │ ├── mod.rs
|
|
1105
|
-
│ │ ├── user.rs
|
|
1106
|
-
│ │ ├── experiment.rs
|
|
1107
|
-
│ │ ├── sample.rs
|
|
1108
|
-
│ │ └── job.rs
|
|
1109
|
-
│ ├── middleware/
|
|
1110
|
-
│ │ ├── auth.rs # JWT validation
|
|
1111
|
-
│ │ ├── rate_limit.rs # Redis-backed rate limiting
|
|
1112
|
-
│ │ └── logging.rs # Structured logging
|
|
1113
|
-
│ ├── services/
|
|
1114
|
-
│ │ ├── database.rs # PostgreSQL connection pool
|
|
1115
|
-
│ │ ├── kafka.rs # Kafka producer
|
|
1116
|
-
│ │ ├── storage.rs # MinIO S3 client
|
|
1117
|
-
│ │ └── cache.rs # Redis client
|
|
1118
|
-
│ └── error.rs # Custom error types
|
|
1119
|
-
├── Cargo.toml
|
|
1120
|
-
└── Dockerfile
|
|
1121
|
-
```
|
|
1122
|
-
|
|
1123
|
-
**Main Server** (src/main.rs):
|
|
1124
|
-
```rust
|
|
1125
|
-
use axum::{
|
|
1126
|
-
Router,
|
|
1127
|
-
routing::{get, post},
|
|
1128
|
-
middleware,
|
|
1129
|
-
Extension,
|
|
1130
|
-
};
|
|
1131
|
-
use tower::ServiceBuilder;
|
|
1132
|
-
use tower_http::trace::TraceLayer;
|
|
1133
|
-
use sqlx::PgPool;
|
|
1134
|
-
use std::net::SocketAddr;
|
|
1135
|
-
|
|
1136
|
-
mod routes;
|
|
1137
|
-
mod models;
|
|
1138
|
-
mod middleware as mw;
|
|
1139
|
-
mod services;
|
|
1140
|
-
mod error;
|
|
1141
|
-
|
|
1142
|
-
#[tokio::main]
|
|
1143
|
-
async fn main() {
|
|
1144
|
-
// Initialize tracing
|
|
1145
|
-
tracing_subscriber::fmt::init();
|
|
1146
|
-
|
|
1147
|
-
// Database connection pool
|
|
1148
|
-
let db_pool = PgPool::connect(&std::env::var("DATABASE_URL").unwrap())
|
|
1149
|
-
.await
|
|
1150
|
-
.expect("Failed to connect to database");
|
|
1151
|
-
|
|
1152
|
-
// Redis client
|
|
1153
|
-
let redis_client = redis::Client::open(std::env::var("REDIS_URL").unwrap())
|
|
1154
|
-
.expect("Failed to connect to Redis");
|
|
1155
|
-
|
|
1156
|
-
// Kafka producer
|
|
1157
|
-
let kafka_producer = services::kafka::create_producer();
|
|
1158
|
-
|
|
1159
|
-
// Build API router
|
|
1160
|
-
let app = Router::new()
|
|
1161
|
-
// Health check
|
|
1162
|
-
.route("/health", get(health_check))
|
|
1163
|
-
|
|
1164
|
-
// API v1 routes
|
|
1165
|
-
.nest("/api/v1", api_v1_routes())
|
|
1166
|
-
|
|
1167
|
-
// Middleware layers
|
|
1168
|
-
.layer(
|
|
1169
|
-
ServiceBuilder::new()
|
|
1170
|
-
.layer(TraceLayer::new_for_http())
|
|
1171
|
-
.layer(middleware::from_fn(mw::logging::log_requests))
|
|
1172
|
-
.layer(Extension(db_pool))
|
|
1173
|
-
.layer(Extension(redis_client))
|
|
1174
|
-
.layer(Extension(kafka_producer))
|
|
1175
|
-
);
|
|
1176
|
-
|
|
1177
|
-
// Start server
|
|
1178
|
-
let addr = SocketAddr::from(([0, 0, 0, 0], 3000));
|
|
1179
|
-
tracing::info!("Listening on {}", addr);
|
|
1180
|
-
|
|
1181
|
-
axum::Server::bind(&addr)
|
|
1182
|
-
.serve(app.into_make_service())
|
|
1183
|
-
.await
|
|
1184
|
-
.unwrap();
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
fn api_v1_routes() -> Router {
|
|
1188
|
-
Router::new()
|
|
1189
|
-
.nest("/auth", routes::auth::routes())
|
|
1190
|
-
.nest("/experiments", routes::experiments::routes())
|
|
1191
|
-
.nest("/samples", routes::samples::routes())
|
|
1192
|
-
.nest("/jobs", routes::jobs::routes())
|
|
1193
|
-
.nest("/results", routes::results::routes())
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
async fn health_check() -> &'static str {
|
|
1197
|
-
"OK"
|
|
1198
|
-
}
|
|
1199
|
-
```
|
|
1200
|
-
|
|
1201
|
-
**Authentication Route** (src/routes/auth.rs):
|
|
1202
|
-
```rust
|
|
1203
|
-
use axum::{Router, Json, routing::post, Extension};
|
|
1204
|
-
use serde::{Deserialize, Serialize};
|
|
1205
|
-
use sqlx::PgPool;
|
|
1206
|
-
use jsonwebtoken::{encode, EncodingKey, Header};
|
|
1207
|
-
use bcrypt::verify;
|
|
1208
|
-
|
|
1209
|
-
pub fn routes() -> Router {
|
|
1210
|
-
Router::new()
|
|
1211
|
-
.route("/login", post(login))
|
|
1212
|
-
.route("/refresh", post(refresh_token))
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
#[derive(Deserialize)]
|
|
1216
|
-
struct LoginRequest {
|
|
1217
|
-
email: String,
|
|
1218
|
-
password: String,
|
|
1219
|
-
}
|
|
1220
|
-
|
|
1221
|
-
#[derive(Serialize)]
|
|
1222
|
-
struct LoginResponse {
|
|
1223
|
-
token: String,
|
|
1224
|
-
refresh_token: String,
|
|
1225
|
-
user: UserInfo,
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
#[derive(Serialize)]
|
|
1229
|
-
struct UserInfo {
|
|
1230
|
-
id: String,
|
|
1231
|
-
email: String,
|
|
1232
|
-
full_name: String,
|
|
1233
|
-
role: String,
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
|
-
async fn login(
|
|
1237
|
-
Extension(pool): Extension<PgPool>,
|
|
1238
|
-
Json(payload): Json<LoginRequest>,
|
|
1239
|
-
) -> Result<Json<LoginResponse>, error::ApiError> {
|
|
1240
|
-
// Query user from database
|
|
1241
|
-
let user = sqlx::query!(
|
|
1242
|
-
"SELECT id, email, full_name, password_hash, role FROM users WHERE email = $1",
|
|
1243
|
-
payload.email
|
|
1244
|
-
)
|
|
1245
|
-
.fetch_optional(&pool)
|
|
1246
|
-
.await?
|
|
1247
|
-
.ok_or(error::ApiError::Unauthorized("Invalid credentials".to_string()))?;
|
|
1248
|
-
|
|
1249
|
-
// Verify password
|
|
1250
|
-
let password_valid = verify(&payload.password, &user.password_hash)?;
|
|
1251
|
-
if !password_valid {
|
|
1252
|
-
return Err(error::ApiError::Unauthorized("Invalid credentials".to_string()));
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
// Generate JWT token
|
|
1256
|
-
let claims = Claims {
|
|
1257
|
-
sub: user.id.to_string(),
|
|
1258
|
-
email: user.email.clone(),
|
|
1259
|
-
role: user.role.clone(),
|
|
1260
|
-
exp: (chrono::Utc::now() + chrono::Duration::hours(24)).timestamp() as usize,
|
|
1261
|
-
};
|
|
1262
|
-
|
|
1263
|
-
let token = encode(
|
|
1264
|
-
&Header::default(),
|
|
1265
|
-
&claims,
|
|
1266
|
-
&EncodingKey::from_secret(std::env::var("JWT_SECRET").unwrap().as_bytes()),
|
|
1267
|
-
)?;
|
|
1268
|
-
|
|
1269
|
-
// Generate refresh token (valid for 7 days)
|
|
1270
|
-
let refresh_claims = Claims {
|
|
1271
|
-
sub: user.id.to_string(),
|
|
1272
|
-
email: user.email.clone(),
|
|
1273
|
-
role: user.role.clone(),
|
|
1274
|
-
exp: (chrono::Utc::now() + chrono::Duration::days(7)).timestamp() as usize,
|
|
1275
|
-
};
|
|
1276
|
-
|
|
1277
|
-
let refresh_token = encode(
|
|
1278
|
-
&Header::default(),
|
|
1279
|
-
&refresh_claims,
|
|
1280
|
-
&EncodingKey::from_secret(std::env::var("JWT_SECRET").unwrap().as_bytes()),
|
|
1281
|
-
)?;
|
|
1282
|
-
|
|
1283
|
-
// Log audit event
|
|
1284
|
-
sqlx::query!(
|
|
1285
|
-
"INSERT INTO audit_log (user_id, action, ip_address) VALUES ($1, $2, $3)",
|
|
1286
|
-
user.id,
|
|
1287
|
-
"login",
|
|
1288
|
-
// Extract IP from request context
|
|
1289
|
-
)
|
|
1290
|
-
.execute(&pool)
|
|
1291
|
-
.await?;
|
|
1292
|
-
|
|
1293
|
-
Ok(Json(LoginResponse {
|
|
1294
|
-
token,
|
|
1295
|
-
refresh_token,
|
|
1296
|
-
user: UserInfo {
|
|
1297
|
-
id: user.id.to_string(),
|
|
1298
|
-
email: user.email,
|
|
1299
|
-
full_name: user.full_name,
|
|
1300
|
-
role: user.role,
|
|
1301
|
-
},
|
|
1302
|
-
}))
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
#[derive(Serialize, Deserialize)]
|
|
1306
|
-
struct Claims {
|
|
1307
|
-
sub: String, // user ID
|
|
1308
|
-
email: String,
|
|
1309
|
-
role: String,
|
|
1310
|
-
exp: usize, // expiration timestamp
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
async fn refresh_token(
|
|
1314
|
-
// Implementation for refreshing JWT tokens
|
|
1315
|
-
) -> Result<Json<LoginResponse>, error::ApiError> {
|
|
1316
|
-
// ... (similar to login, but validates refresh token)
|
|
1317
|
-
todo!()
|
|
1318
|
-
}
|
|
1319
|
-
```
|
|
1320
|
-
|
|
1321
|
-
**Job Submission Route** (src/routes/jobs.rs):
|
|
1322
|
-
```rust
|
|
1323
|
-
use axum::{Router, Json, routing::{post, get}, Extension};
|
|
1324
|
-
use serde::{Deserialize, Serialize};
|
|
1325
|
-
use sqlx::PgPool;
|
|
1326
|
-
use rdkafka::producer::FutureProducer;
|
|
1327
|
-
use uuid::Uuid;
|
|
1328
|
-
|
|
1329
|
-
pub fn routes() -> Router {
|
|
1330
|
-
Router::new()
|
|
1331
|
-
.route("/", post(submit_job))
|
|
1332
|
-
.route("/:job_id", get(get_job_status))
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
#[derive(Deserialize)]
|
|
1336
|
-
struct SubmitJobRequest {
|
|
1337
|
-
experiment_id: String,
|
|
1338
|
-
job_type: String, // alignment, off_target, diff_expr
|
|
1339
|
-
parameters: serde_json::Value,
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
#[derive(Serialize)]
|
|
1343
|
-
struct SubmitJobResponse {
|
|
1344
|
-
job_id: String,
|
|
1345
|
-
status: String,
|
|
1346
|
-
message: String,
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
async fn submit_job(
|
|
1350
|
-
Extension(pool): Extension<PgPool>,
|
|
1351
|
-
Extension(producer): Extension<FutureProducer>,
|
|
1352
|
-
// Extract authenticated user from middleware
|
|
1353
|
-
Json(payload): Json<SubmitJobRequest>,
|
|
1354
|
-
) -> Result<Json<SubmitJobResponse>, error::ApiError> {
|
|
1355
|
-
let job_id = Uuid::new_v4();
|
|
1356
|
-
|
|
1357
|
-
// Insert job record into database
|
|
1358
|
-
sqlx::query!(
|
|
1359
|
-
"INSERT INTO analysis_jobs (id, experiment_id, job_type, status) VALUES ($1, $2, $3, $4)",
|
|
1360
|
-
job_id,
|
|
1361
|
-
Uuid::parse_str(&payload.experiment_id)?,
|
|
1362
|
-
payload.job_type,
|
|
1363
|
-
"queued"
|
|
1364
|
-
)
|
|
1365
|
-
.execute(&pool)
|
|
1366
|
-
.await?;
|
|
1367
|
-
|
|
1368
|
-
// Publish job to Kafka
|
|
1369
|
-
let topic = match payload.job_type.as_str() {
|
|
1370
|
-
"alignment" => "jobs.alignment",
|
|
1371
|
-
"off_target" => "jobs.off_target",
|
|
1372
|
-
"diff_expr" => "jobs.diff_expr",
|
|
1373
|
-
_ => return Err(error::ApiError::BadRequest("Invalid job type".to_string())),
|
|
1374
|
-
};
|
|
1375
|
-
|
|
1376
|
-
let job_message = serde_json::json!({
|
|
1377
|
-
"job_id": job_id.to_string(),
|
|
1378
|
-
"experiment_id": payload.experiment_id,
|
|
1379
|
-
"parameters": payload.parameters,
|
|
1380
|
-
});
|
|
1381
|
-
|
|
1382
|
-
producer
|
|
1383
|
-
.send(
|
|
1384
|
-
FutureRecord::to(topic)
|
|
1385
|
-
.payload(&serde_json::to_string(&job_message)?)
|
|
1386
|
-
.key(&job_id.to_string()),
|
|
1387
|
-
Duration::from_secs(5),
|
|
1388
|
-
)
|
|
1389
|
-
.await
|
|
1390
|
-
.map_err(|e| error::ApiError::Internal(format!("Kafka error: {:?}", e)))?;
|
|
1391
|
-
|
|
1392
|
-
Ok(Json(SubmitJobResponse {
|
|
1393
|
-
job_id: job_id.to_string(),
|
|
1394
|
-
status: "queued".to_string(),
|
|
1395
|
-
message: format!("Job {} submitted successfully", job_id),
|
|
1396
|
-
}))
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
async fn get_job_status(
|
|
1400
|
-
Extension(pool): Extension<PgPool>,
|
|
1401
|
-
axum::extract::Path(job_id): axum::extract::Path<String>,
|
|
1402
|
-
) -> Result<Json<JobStatus>, error::ApiError> {
|
|
1403
|
-
let job = sqlx::query_as!(
|
|
1404
|
-
JobStatus,
|
|
1405
|
-
"SELECT id, status, started_at, completed_at, error_message FROM analysis_jobs WHERE id = $1",
|
|
1406
|
-
Uuid::parse_str(&job_id)?
|
|
1407
|
-
)
|
|
1408
|
-
.fetch_optional(&pool)
|
|
1409
|
-
.await?
|
|
1410
|
-
.ok_or(error::ApiError::NotFound("Job not found".to_string()))?;
|
|
1411
|
-
|
|
1412
|
-
Ok(Json(job))
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
#[derive(Serialize)]
|
|
1416
|
-
struct JobStatus {
|
|
1417
|
-
id: Uuid,
|
|
1418
|
-
status: String,
|
|
1419
|
-
started_at: Option<chrono::DateTime<chrono::Utc>>,
|
|
1420
|
-
completed_at: Option<chrono::DateTime<chrono::Utc>>,
|
|
1421
|
-
error_message: Option<String>,
|
|
1422
|
-
}
|
|
1423
|
-
```
|
|
1424
|
-
|
|
1425
|
-
---
|
|
1426
|
-
|
|
1427
|
-
### 5.2 API Versioning Strategy
|
|
1428
|
-
|
|
1429
|
-
**Approach**: URL path versioning (`/api/v1`, `/api/v2`)
|
|
1430
|
-
|
|
1431
|
-
**Version Support Policy**:
|
|
1432
|
-
- **v1**: Current stable version (launched 2025-Q1)
|
|
1433
|
-
- **v2**: Next major version (planned 2025-Q3)
|
|
1434
|
-
- **Deprecation**: v1 will be deprecated 12 months after v2 launch
|
|
1435
|
-
- **Sunset**: v1 will be removed 6 months after deprecation notice
|
|
1436
|
-
|
|
1437
|
-
**Backward Compatibility**:
|
|
1438
|
-
- Additive changes only (new fields, new endpoints)
|
|
1439
|
-
- Breaking changes trigger new major version
|
|
1440
|
-
- Clients specify version in `Accept` header: `application/vnd.crispr.v1+json`
|
|
1441
|
-
|
|
1442
|
-
---
|
|
1443
|
-
|
|
1444
|
-
### 5.3 Rate Limiting
|
|
1445
|
-
|
|
1446
|
-
**Implementation**: Redis sliding window algorithm
|
|
1447
|
-
|
|
1448
|
-
```rust
|
|
1449
|
-
// src/middleware/rate_limit.rs
|
|
1450
|
-
use axum::{middleware::Next, http::{Request, StatusCode}, response::Response};
|
|
1451
|
-
use redis::AsyncCommands;
|
|
1452
|
-
|
|
1453
|
-
pub async fn rate_limit_middleware<B>(
|
|
1454
|
-
Extension(redis): Extension<redis::Client>,
|
|
1455
|
-
request: Request<B>,
|
|
1456
|
-
next: Next<B>,
|
|
1457
|
-
) -> Result<Response, StatusCode> {
|
|
1458
|
-
let user_id = extract_user_id(&request)?; // From JWT
|
|
1459
|
-
let key = format!("rate_limit:{}:{}", user_id, get_current_minute());
|
|
1460
|
-
|
|
1461
|
-
let mut conn = redis.get_async_connection().await
|
|
1462
|
-
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
|
|
1463
|
-
|
|
1464
|
-
// Increment request count
|
|
1465
|
-
let count: u32 = conn.incr(&key, 1).await
|
|
1466
|
-
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
|
|
1467
|
-
|
|
1468
|
-
// Set expiry on first request
|
|
1469
|
-
if count == 1 {
|
|
1470
|
-
conn.expire(&key, 60).await
|
|
1471
|
-
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
|
-
// Check limit (100 requests per minute for standard users)
|
|
1475
|
-
let limit = get_user_rate_limit(&user_id);
|
|
1476
|
-
if count > limit {
|
|
1477
|
-
return Err(StatusCode::TOO_MANY_REQUESTS);
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1480
|
-
Ok(next.run(request).await)
|
|
1481
|
-
}
|
|
1482
|
-
|
|
1483
|
-
fn get_user_rate_limit(user_id: &str) -> u32 {
|
|
1484
|
-
// Query user role from database/cache
|
|
1485
|
-
// admin: 1000, researcher: 100, guest: 10
|
|
1486
|
-
100
|
|
1487
|
-
}
|
|
1488
|
-
```
|
|
1489
|
-
|
|
1490
|
-
**Rate Limits**:
|
|
1491
|
-
- **Admin**: 1000 requests/minute
|
|
1492
|
-
- **Researcher**: 100 requests/minute
|
|
1493
|
-
- **Guest**: 10 requests/minute
|
|
1494
|
-
|
|
1495
|
-
---
|
|
1496
|
-
|
|
1497
|
-
### 5.4 WebSocket Support (Real-Time Updates)
|
|
1498
|
-
|
|
1499
|
-
**Purpose**: Push job progress updates to UI in real-time
|
|
1500
|
-
|
|
1501
|
-
**Implementation** (using `axum::extract::ws`):
|
|
1502
|
-
|
|
1503
|
-
```rust
|
|
1504
|
-
use axum::{
|
|
1505
|
-
extract::ws::{WebSocket, WebSocketUpgrade, Message},
|
|
1506
|
-
response::Response,
|
|
1507
|
-
Extension,
|
|
1508
|
-
};
|
|
1509
|
-
use tokio::sync::broadcast;
|
|
1510
|
-
|
|
1511
|
-
pub async fn websocket_handler(
|
|
1512
|
-
ws: WebSocketUpgrade,
|
|
1513
|
-
Extension(tx): Extension<broadcast::Sender<String>>,
|
|
1514
|
-
) -> Response {
|
|
1515
|
-
ws.on_upgrade(|socket| handle_socket(socket, tx))
|
|
1516
|
-
}
|
|
1517
|
-
|
|
1518
|
-
async fn handle_socket(mut socket: WebSocket, tx: broadcast::Sender<String>) {
|
|
1519
|
-
let mut rx = tx.subscribe();
|
|
1520
|
-
|
|
1521
|
-
loop {
|
|
1522
|
-
tokio::select! {
|
|
1523
|
-
// Receive messages from client (e.g., subscribe to specific job)
|
|
1524
|
-
Some(msg) = socket.recv() => {
|
|
1525
|
-
if let Ok(Message::Text(text)) = msg {
|
|
1526
|
-
// Handle subscription requests
|
|
1527
|
-
tracing::info!("Received: {}", text);
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1530
|
-
|
|
1531
|
-
// Broadcast job updates to client
|
|
1532
|
-
Ok(update) = rx.recv() => {
|
|
1533
|
-
if socket.send(Message::Text(update)).await.is_err() {
|
|
1534
|
-
break; // Client disconnected
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
}
|
|
1539
|
-
}
|
|
1540
|
-
```
|
|
1541
|
-
|
|
1542
|
-
**Kafka Consumer** (publishes to WebSocket broadcast channel):
|
|
1543
|
-
```rust
|
|
1544
|
-
async fn consume_job_updates(tx: broadcast::Sender<String>) {
|
|
1545
|
-
let consumer: StreamConsumer = ClientConfig::new()
|
|
1546
|
-
.set("group.id", "websocket-broadcaster")
|
|
1547
|
-
.set("bootstrap.servers", "kafka:9092")
|
|
1548
|
-
.create()
|
|
1549
|
-
.expect("Consumer creation failed");
|
|
1550
|
-
|
|
1551
|
-
consumer.subscribe(&["jobs.progress"]).unwrap();
|
|
1552
|
-
|
|
1553
|
-
loop {
|
|
1554
|
-
match consumer.recv().await {
|
|
1555
|
-
Ok(message) => {
|
|
1556
|
-
if let Some(payload) = message.payload() {
|
|
1557
|
-
let update = String::from_utf8_lossy(payload).to_string();
|
|
1558
|
-
let _ = tx.send(update); // Broadcast to all WebSocket clients
|
|
1559
|
-
}
|
|
1560
|
-
}
|
|
1561
|
-
Err(e) => tracing::error!("Kafka error: {:?}", e),
|
|
1562
|
-
}
|
|
1563
|
-
}
|
|
1564
|
-
}
|
|
1565
|
-
```
|
|
1566
|
-
|
|
1567
|
-
---
|
|
1568
|
-
|
|
1569
|
-
## 6. UI Layer
|
|
1570
|
-
|
|
1571
|
-
### 6.1 React TypeScript Frontend
|
|
1572
|
-
|
|
1573
|
-
**Technology Stack**:
|
|
1574
|
-
- **Framework**: React 18 with TypeScript 5.3
|
|
1575
|
-
- **Build Tool**: Vite 5.0 (fast HMR, optimized production builds)
|
|
1576
|
-
- **State Management**: Zustand (lightweight, <1KB)
|
|
1577
|
-
- **Routing**: React Router v6
|
|
1578
|
-
- **UI Components**: Shadcn/ui (Radix UI + Tailwind CSS)
|
|
1579
|
-
- **Data Fetching**: TanStack Query (React Query) for caching
|
|
1580
|
-
- **Visualization**: D3.js, Plotly.js, IGV.js (genomic browser)
|
|
1581
|
-
- **Testing**: Vitest, React Testing Library
|
|
1582
|
-
|
|
1583
|
-
**Project Structure**:
|
|
1584
|
-
```
|
|
1585
|
-
frontend/
|
|
1586
|
-
├── src/
|
|
1587
|
-
│ ├── App.tsx # Root component
|
|
1588
|
-
│ ├── main.tsx # Entry point
|
|
1589
|
-
│ ├── pages/
|
|
1590
|
-
│ │ ├── Dashboard.tsx # Overview, recent experiments
|
|
1591
|
-
│ │ ├── ExperimentWizard.tsx # Step-by-step experiment setup
|
|
1592
|
-
│ │ ├── ExperimentDetail.tsx # View experiment results
|
|
1593
|
-
│ │ ├── JobMonitor.tsx # Real-time job tracking
|
|
1594
|
-
│ │ └── Visualizations.tsx # Interactive plots
|
|
1595
|
-
│ ├── components/
|
|
1596
|
-
│ │ ├── Layout/
|
|
1597
|
-
│ │ │ ├── Header.tsx
|
|
1598
|
-
│ │ │ ├── Sidebar.tsx
|
|
1599
|
-
│ │ │ └── Footer.tsx
|
|
1600
|
-
│ │ ├── Experiments/
|
|
1601
|
-
│ │ │ ├── ExperimentCard.tsx
|
|
1602
|
-
│ │ │ ├── ExperimentForm.tsx
|
|
1603
|
-
│ │ │ └── SampleUploader.tsx
|
|
1604
|
-
│ │ ├── Jobs/
|
|
1605
|
-
│ │ │ ├── JobCard.tsx
|
|
1606
|
-
│ │ │ ├── JobProgressBar.tsx
|
|
1607
|
-
│ │ │ └── JobTimeline.tsx
|
|
1608
|
-
│ │ └── Visualizations/
|
|
1609
|
-
│ │ ├── VolcanoPlot.tsx # D3.js volcano plot
|
|
1610
|
-
│ │ ├── MAPlot.tsx # M-A plot for diff expr
|
|
1611
|
-
│ │ ├── Heatmap.tsx # Gene expression heatmap
|
|
1612
|
-
│ │ └── GenomeBrowser.tsx # IGV.js integration
|
|
1613
|
-
│ ├── hooks/
|
|
1614
|
-
│ │ ├── useExperiments.ts # React Query hooks
|
|
1615
|
-
│ │ ├── useJobs.ts
|
|
1616
|
-
│ │ ├── useWebSocket.ts # WebSocket connection
|
|
1617
|
-
│ │ └── useAuth.ts # Authentication state
|
|
1618
|
-
│ ├── stores/
|
|
1619
|
-
│ │ ├── authStore.ts # Zustand auth store
|
|
1620
|
-
│ │ └── uiStore.ts # UI preferences
|
|
1621
|
-
│ ├── api/
|
|
1622
|
-
│ │ └── client.ts # Axios API client
|
|
1623
|
-
│ └── utils/
|
|
1624
|
-
│ ├── formatters.ts
|
|
1625
|
-
│ └── validators.ts
|
|
1626
|
-
├── public/
|
|
1627
|
-
├── index.html
|
|
1628
|
-
├── package.json
|
|
1629
|
-
├── vite.config.ts
|
|
1630
|
-
└── tsconfig.json
|
|
1631
|
-
```
|
|
1632
|
-
|
|
1633
|
-
---
|
|
1634
|
-
|
|
1635
|
-
### 6.2 Component Hierarchy
|
|
1636
|
-
|
|
1637
|
-
```
|
|
1638
|
-
App
|
|
1639
|
-
├── AuthProvider
|
|
1640
|
-
│ ├── LoginPage
|
|
1641
|
-
│ └── ProtectedRoutes
|
|
1642
|
-
│ ├── Layout
|
|
1643
|
-
│ │ ├── Header
|
|
1644
|
-
│ │ ├── Sidebar
|
|
1645
|
-
│ │ └── Main
|
|
1646
|
-
│ │ ├── Dashboard
|
|
1647
|
-
│ │ │ ├── ExperimentCard[]
|
|
1648
|
-
│ │ │ ├── JobCard[]
|
|
1649
|
-
│ │ │ └── QuickStats
|
|
1650
|
-
│ │ ├── ExperimentWizard
|
|
1651
|
-
│ │ │ ├── Step1_BasicInfo
|
|
1652
|
-
│ │ │ ├── Step2_GuideRNA
|
|
1653
|
-
│ │ │ ├── Step3_Samples
|
|
1654
|
-
│ │ │ └── Step4_Analysis
|
|
1655
|
-
│ │ ├── ExperimentDetail
|
|
1656
|
-
│ │ │ ├── ExperimentHeader
|
|
1657
|
-
│ │ │ ├── SampleTable
|
|
1658
|
-
│ │ │ ├── JobTimeline
|
|
1659
|
-
│ │ │ └── ResultsTabs
|
|
1660
|
-
│ │ │ ├── OffTargetsTab
|
|
1661
|
-
│ │ │ │ └── OffTargetTable
|
|
1662
|
-
│ │ │ ├── DiffExprTab
|
|
1663
|
-
│ │ │ │ ├── VolcanoPlot
|
|
1664
|
-
│ │ │ │ ├── MAPlot
|
|
1665
|
-
│ │ │ │ └── GeneTable
|
|
1666
|
-
│ │ │ └── ImmuneResponseTab
|
|
1667
|
-
│ │ │ ├── SignatureEnrichment
|
|
1668
|
-
│ │ │ └── PathwayHeatmap
|
|
1669
|
-
│ │ └── JobMonitor
|
|
1670
|
-
│ │ ├── JobList
|
|
1671
|
-
│ │ └── JobDetails
|
|
1672
|
-
│ │ ├── JobProgressBar
|
|
1673
|
-
│ │ ├── JobLogs
|
|
1674
|
-
│ │ └── ResourceUsage
|
|
1675
|
-
└── Footer
|
|
1676
|
-
```
|
|
1677
|
-
|
|
1678
|
-
---
|
|
1679
|
-
|
|
1680
|
-
### 6.3 Key Components
|
|
1681
|
-
|
|
1682
|
-
#### 6.3.1 Experiment Wizard
|
|
1683
|
-
|
|
1684
|
-
**Multi-step form for creating new experiments**:
|
|
1685
|
-
|
|
1686
|
-
```tsx
|
|
1687
|
-
// src/pages/ExperimentWizard.tsx
|
|
1688
|
-
import { useState } from 'react';
|
|
1689
|
-
import { useMutation } from '@tanstack/react-query';
|
|
1690
|
-
import { api } from '@/api/client';
|
|
1691
|
-
|
|
1692
|
-
interface ExperimentForm {
|
|
1693
|
-
name: string;
|
|
1694
|
-
description: string;
|
|
1695
|
-
organism: string;
|
|
1696
|
-
targetGene: string;
|
|
1697
|
-
cas13Variant: 'Cas13a' | 'Cas13b' | 'Cas13d';
|
|
1698
|
-
guideRNASequence: string;
|
|
1699
|
-
samples: Sample[];
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
interface Sample {
|
|
1703
|
-
name: string;
|
|
1704
|
-
type: string;
|
|
1705
|
-
fastqR1: File;
|
|
1706
|
-
fastqR2?: File;
|
|
1707
|
-
}
|
|
1708
|
-
|
|
1709
|
-
export function ExperimentWizard() {
|
|
1710
|
-
const [step, setStep] = useState(1);
|
|
1711
|
-
const [formData, setFormData] = useState<Partial<ExperimentForm>>({});
|
|
1712
|
-
|
|
1713
|
-
const createExperiment = useMutation({
|
|
1714
|
-
mutationFn: async (data: ExperimentForm) => {
|
|
1715
|
-
// Upload FASTQ files to MinIO
|
|
1716
|
-
const uploadedSamples = await Promise.all(
|
|
1717
|
-
data.samples.map(async (sample) => {
|
|
1718
|
-
const formData = new FormData();
|
|
1719
|
-
formData.append('file', sample.fastqR1);
|
|
1720
|
-
if (sample.fastqR2) formData.append('file', sample.fastqR2);
|
|
1721
|
-
|
|
1722
|
-
const response = await api.post('/api/v1/samples/upload', formData);
|
|
1723
|
-
return { ...sample, ...response.data };
|
|
1724
|
-
})
|
|
1725
|
-
);
|
|
1726
|
-
|
|
1727
|
-
// Create experiment
|
|
1728
|
-
return api.post('/api/v1/experiments', {
|
|
1729
|
-
...data,
|
|
1730
|
-
samples: uploadedSamples,
|
|
1731
|
-
});
|
|
1732
|
-
},
|
|
1733
|
-
onSuccess: (data) => {
|
|
1734
|
-
// Redirect to experiment detail page
|
|
1735
|
-
navigate(`/experiments/${data.data.id}`);
|
|
1736
|
-
},
|
|
1737
|
-
});
|
|
1738
|
-
|
|
1739
|
-
const handleNext = () => {
|
|
1740
|
-
if (step < 4) setStep(step + 1);
|
|
1741
|
-
else createExperiment.mutate(formData as ExperimentForm);
|
|
1742
|
-
};
|
|
1743
|
-
|
|
1744
|
-
return (
|
|
1745
|
-
<div className="max-w-4xl mx-auto p-6">
|
|
1746
|
-
<h1 className="text-3xl font-bold mb-8">Create New Experiment</h1>
|
|
1747
|
-
|
|
1748
|
-
<div className="mb-8">
|
|
1749
|
-
<StepIndicator currentStep={step} />
|
|
1750
|
-
</div>
|
|
1751
|
-
|
|
1752
|
-
{step === 1 && <BasicInfoStep data={formData} onChange={setFormData} />}
|
|
1753
|
-
{step === 2 && <GuideRNAStep data={formData} onChange={setFormData} />}
|
|
1754
|
-
{step === 3 && <SamplesStep data={formData} onChange={setFormData} />}
|
|
1755
|
-
{step === 4 && <AnalysisStep data={formData} onChange={setFormData} />}
|
|
1756
|
-
|
|
1757
|
-
<div className="mt-8 flex justify-between">
|
|
1758
|
-
<button onClick={() => setStep(step - 1)} disabled={step === 1}>
|
|
1759
|
-
Previous
|
|
1760
|
-
</button>
|
|
1761
|
-
<button onClick={handleNext} disabled={!isStepValid(step, formData)}>
|
|
1762
|
-
{step === 4 ? 'Submit' : 'Next'}
|
|
1763
|
-
</button>
|
|
1764
|
-
</div>
|
|
1765
|
-
</div>
|
|
1766
|
-
);
|
|
1767
|
-
}
|
|
1768
|
-
```
|
|
1769
|
-
|
|
1770
|
-
---
|
|
1771
|
-
|
|
1772
|
-
#### 6.3.2 Real-Time Job Monitor
|
|
1773
|
-
|
|
1774
|
-
**WebSocket-powered live job tracking**:
|
|
1775
|
-
|
|
1776
|
-
```tsx
|
|
1777
|
-
// src/hooks/useWebSocket.ts
|
|
1778
|
-
import { useEffect, useState } from 'react';
|
|
1779
|
-
|
|
1780
|
-
export function useWebSocket(url: string) {
|
|
1781
|
-
const [messages, setMessages] = useState<string[]>([]);
|
|
1782
|
-
const [socket, setSocket] = useState<WebSocket | null>(null);
|
|
1783
|
-
|
|
1784
|
-
useEffect(() => {
|
|
1785
|
-
const ws = new WebSocket(url);
|
|
1786
|
-
|
|
1787
|
-
ws.onopen = () => {
|
|
1788
|
-
console.log('WebSocket connected');
|
|
1789
|
-
};
|
|
1790
|
-
|
|
1791
|
-
ws.onmessage = (event) => {
|
|
1792
|
-
const update = JSON.parse(event.data);
|
|
1793
|
-
setMessages((prev) => [...prev, update]);
|
|
1794
|
-
};
|
|
1795
|
-
|
|
1796
|
-
ws.onerror = (error) => {
|
|
1797
|
-
console.error('WebSocket error:', error);
|
|
1798
|
-
};
|
|
1799
|
-
|
|
1800
|
-
ws.onclose = () => {
|
|
1801
|
-
console.log('WebSocket disconnected');
|
|
1802
|
-
};
|
|
1803
|
-
|
|
1804
|
-
setSocket(ws);
|
|
1805
|
-
|
|
1806
|
-
return () => {
|
|
1807
|
-
ws.close();
|
|
1808
|
-
};
|
|
1809
|
-
}, [url]);
|
|
1810
|
-
|
|
1811
|
-
const sendMessage = (message: string) => {
|
|
1812
|
-
if (socket && socket.readyState === WebSocket.OPEN) {
|
|
1813
|
-
socket.send(message);
|
|
1814
|
-
}
|
|
1815
|
-
};
|
|
1816
|
-
|
|
1817
|
-
return { messages, sendMessage };
|
|
1818
|
-
}
|
|
1819
|
-
```
|
|
1820
|
-
|
|
1821
|
-
```tsx
|
|
1822
|
-
// src/pages/JobMonitor.tsx
|
|
1823
|
-
import { useWebSocket } from '@/hooks/useWebSocket';
|
|
1824
|
-
import { useQuery } from '@tanstack/react-query';
|
|
1825
|
-
|
|
1826
|
-
export function JobMonitor() {
|
|
1827
|
-
const { data: jobs } = useQuery({
|
|
1828
|
-
queryKey: ['jobs'],
|
|
1829
|
-
queryFn: () => api.get('/api/v1/jobs'),
|
|
1830
|
-
refetchInterval: 5000, // Fallback polling
|
|
1831
|
-
});
|
|
1832
|
-
|
|
1833
|
-
const { messages } = useWebSocket('wss://api.crispr.example.com/ws');
|
|
1834
|
-
|
|
1835
|
-
// Merge WebSocket updates with initial job data
|
|
1836
|
-
const [liveJobs, setLiveJobs] = useState(jobs || []);
|
|
1837
|
-
|
|
1838
|
-
useEffect(() => {
|
|
1839
|
-
messages.forEach((update) => {
|
|
1840
|
-
setLiveJobs((prev) =>
|
|
1841
|
-
prev.map((job) =>
|
|
1842
|
-
job.id === update.job_id ? { ...job, ...update } : job
|
|
1843
|
-
)
|
|
1844
|
-
);
|
|
1845
|
-
});
|
|
1846
|
-
}, [messages]);
|
|
1847
|
-
|
|
1848
|
-
return (
|
|
1849
|
-
<div>
|
|
1850
|
-
<h1>Job Monitor</h1>
|
|
1851
|
-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
1852
|
-
{liveJobs.map((job) => (
|
|
1853
|
-
<JobCard key={job.id} job={job} />
|
|
1854
|
-
))}
|
|
1855
|
-
</div>
|
|
1856
|
-
</div>
|
|
1857
|
-
);
|
|
1858
|
-
}
|
|
1859
|
-
|
|
1860
|
-
function JobCard({ job }: { job: Job }) {
|
|
1861
|
-
const statusColor = {
|
|
1862
|
-
queued: 'bg-gray-500',
|
|
1863
|
-
running: 'bg-blue-500',
|
|
1864
|
-
completed: 'bg-green-500',
|
|
1865
|
-
failed: 'bg-red-500',
|
|
1866
|
-
}[job.status];
|
|
1867
|
-
|
|
1868
|
-
return (
|
|
1869
|
-
<div className="border rounded-lg p-4">
|
|
1870
|
-
<div className="flex items-center justify-between mb-2">
|
|
1871
|
-
<h3 className="font-bold">{job.job_type}</h3>
|
|
1872
|
-
<span className={`px-2 py-1 rounded text-white text-sm ${statusColor}`}>
|
|
1873
|
-
{job.status}
|
|
1874
|
-
</span>
|
|
1875
|
-
</div>
|
|
1876
|
-
|
|
1877
|
-
{job.status === 'running' && (
|
|
1878
|
-
<div className="w-full bg-gray-200 rounded-full h-2">
|
|
1879
|
-
<div
|
|
1880
|
-
className="bg-blue-600 h-2 rounded-full transition-all duration-300"
|
|
1881
|
-
style={{ width: `${job.progress || 0}%` }}
|
|
1882
|
-
/>
|
|
1883
|
-
</div>
|
|
1884
|
-
)}
|
|
1885
|
-
|
|
1886
|
-
<div className="text-sm text-gray-600 mt-2">
|
|
1887
|
-
Started: {new Date(job.started_at).toLocaleString()}
|
|
1888
|
-
</div>
|
|
1889
|
-
</div>
|
|
1890
|
-
);
|
|
1891
|
-
}
|
|
1892
|
-
```
|
|
1893
|
-
|
|
1894
|
-
---
|
|
1895
|
-
|
|
1896
|
-
#### 6.3.3 Interactive Visualizations
|
|
1897
|
-
|
|
1898
|
-
**Volcano Plot with D3.js**:
|
|
1899
|
-
|
|
1900
|
-
```tsx
|
|
1901
|
-
// src/components/Visualizations/VolcanoPlot.tsx
|
|
1902
|
-
import { useEffect, useRef } from 'react';
|
|
1903
|
-
import * as d3 from 'd3';
|
|
1904
|
-
|
|
1905
|
-
interface Gene {
|
|
1906
|
-
gene_symbol: string;
|
|
1907
|
-
log2_fold_change: number;
|
|
1908
|
-
padj: number;
|
|
1909
|
-
}
|
|
1910
|
-
|
|
1911
|
-
export function VolcanoPlot({ data }: { data: Gene[] }) {
|
|
1912
|
-
const svgRef = useRef<SVGSVGElement>(null);
|
|
1913
|
-
|
|
1914
|
-
useEffect(() => {
|
|
1915
|
-
if (!svgRef.current || !data.length) return;
|
|
1916
|
-
|
|
1917
|
-
const width = 800;
|
|
1918
|
-
const height = 600;
|
|
1919
|
-
const margin = { top: 20, right: 20, bottom: 50, left: 60 };
|
|
1920
|
-
|
|
1921
|
-
// Clear previous plot
|
|
1922
|
-
d3.select(svgRef.current).selectAll('*').remove();
|
|
1923
|
-
|
|
1924
|
-
const svg = d3.select(svgRef.current)
|
|
1925
|
-
.attr('width', width)
|
|
1926
|
-
.attr('height', height);
|
|
1927
|
-
|
|
1928
|
-
// Transform data
|
|
1929
|
-
const plotData = data.map((gene) => ({
|
|
1930
|
-
...gene,
|
|
1931
|
-
neg_log10_padj: -Math.log10(gene.padj),
|
|
1932
|
-
significant: gene.padj < 0.05 && Math.abs(gene.log2_fold_change) > 1,
|
|
1933
|
-
}));
|
|
1934
|
-
|
|
1935
|
-
// Scales
|
|
1936
|
-
const xScale = d3.scaleLinear()
|
|
1937
|
-
.domain(d3.extent(plotData, (d) => d.log2_fold_change) as [number, number])
|
|
1938
|
-
.range([margin.left, width - margin.right]);
|
|
1939
|
-
|
|
1940
|
-
const yScale = d3.scaleLinear()
|
|
1941
|
-
.domain([0, d3.max(plotData, (d) => d.neg_log10_padj) as number])
|
|
1942
|
-
.range([height - margin.bottom, margin.top]);
|
|
1943
|
-
|
|
1944
|
-
// Axes
|
|
1945
|
-
svg.append('g')
|
|
1946
|
-
.attr('transform', `translate(0, ${height - margin.bottom})`)
|
|
1947
|
-
.call(d3.axisBottom(xScale));
|
|
1948
|
-
|
|
1949
|
-
svg.append('g')
|
|
1950
|
-
.attr('transform', `translate(${margin.left}, 0)`)
|
|
1951
|
-
.call(d3.axisLeft(yScale));
|
|
1952
|
-
|
|
1953
|
-
// Points
|
|
1954
|
-
svg.selectAll('circle')
|
|
1955
|
-
.data(plotData)
|
|
1956
|
-
.join('circle')
|
|
1957
|
-
.attr('cx', (d) => xScale(d.log2_fold_change))
|
|
1958
|
-
.attr('cy', (d) => yScale(d.neg_log10_padj))
|
|
1959
|
-
.attr('r', 3)
|
|
1960
|
-
.attr('fill', (d) => (d.significant ? '#e74c3c' : '#95a5a6'))
|
|
1961
|
-
.attr('opacity', 0.6)
|
|
1962
|
-
.on('mouseover', function (event, d) {
|
|
1963
|
-
d3.select(this).attr('r', 6).attr('opacity', 1);
|
|
1964
|
-
|
|
1965
|
-
// Show tooltip
|
|
1966
|
-
tooltip
|
|
1967
|
-
.style('opacity', 1)
|
|
1968
|
-
.html(`<strong>${d.gene_symbol}</strong><br/>
|
|
1969
|
-
Log2FC: ${d.log2_fold_change.toFixed(2)}<br/>
|
|
1970
|
-
Adj. p-value: ${d.padj.toExponential(2)}`)
|
|
1971
|
-
.style('left', `${event.pageX + 10}px`)
|
|
1972
|
-
.style('top', `${event.pageY - 20}px`);
|
|
1973
|
-
})
|
|
1974
|
-
.on('mouseout', function () {
|
|
1975
|
-
d3.select(this).attr('r', 3).attr('opacity', 0.6);
|
|
1976
|
-
tooltip.style('opacity', 0);
|
|
1977
|
-
});
|
|
1978
|
-
|
|
1979
|
-
// Tooltip
|
|
1980
|
-
const tooltip = d3.select('body')
|
|
1981
|
-
.append('div')
|
|
1982
|
-
.attr('class', 'tooltip')
|
|
1983
|
-
.style('position', 'absolute')
|
|
1984
|
-
.style('background', 'white')
|
|
1985
|
-
.style('border', '1px solid #ccc')
|
|
1986
|
-
.style('padding', '10px')
|
|
1987
|
-
.style('border-radius', '5px')
|
|
1988
|
-
.style('opacity', 0);
|
|
1989
|
-
|
|
1990
|
-
// Threshold lines
|
|
1991
|
-
svg.append('line')
|
|
1992
|
-
.attr('x1', xScale(-1))
|
|
1993
|
-
.attr('x2', xScale(-1))
|
|
1994
|
-
.attr('y1', margin.top)
|
|
1995
|
-
.attr('y2', height - margin.bottom)
|
|
1996
|
-
.attr('stroke', 'gray')
|
|
1997
|
-
.attr('stroke-dasharray', '4');
|
|
1998
|
-
|
|
1999
|
-
svg.append('line')
|
|
2000
|
-
.attr('x1', xScale(1))
|
|
2001
|
-
.attr('x2', xScale(1))
|
|
2002
|
-
.attr('y1', margin.top)
|
|
2003
|
-
.attr('y2', height - margin.bottom)
|
|
2004
|
-
.attr('stroke', 'gray')
|
|
2005
|
-
.attr('stroke-dasharray', '4');
|
|
2006
|
-
|
|
2007
|
-
svg.append('line')
|
|
2008
|
-
.attr('x1', margin.left)
|
|
2009
|
-
.attr('x2', width - margin.right)
|
|
2010
|
-
.attr('y1', yScale(-Math.log10(0.05)))
|
|
2011
|
-
.attr('y2', yScale(-Math.log10(0.05)))
|
|
2012
|
-
.attr('stroke', 'gray')
|
|
2013
|
-
.attr('stroke-dasharray', '4');
|
|
2014
|
-
}, [data]);
|
|
2015
|
-
|
|
2016
|
-
return <svg ref={svgRef} />;
|
|
2017
|
-
}
|
|
2018
|
-
```
|
|
2019
|
-
|
|
2020
|
-
**Genomic Browser with IGV.js**:
|
|
2021
|
-
|
|
2022
|
-
```tsx
|
|
2023
|
-
// src/components/Visualizations/GenomeBrowser.tsx
|
|
2024
|
-
import { useEffect, useRef } from 'react';
|
|
2025
|
-
import igv from 'igv';
|
|
2026
|
-
|
|
2027
|
-
export function GenomeBrowser({ bam_url, region }: { bam_url: string; region: string }) {
|
|
2028
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
2029
|
-
|
|
2030
|
-
useEffect(() => {
|
|
2031
|
-
if (!containerRef.current) return;
|
|
2032
|
-
|
|
2033
|
-
const options = {
|
|
2034
|
-
genome: 'macFas5', // Rhesus macaque genome
|
|
2035
|
-
locus: region, // e.g., "chr1:1000000-2000000"
|
|
2036
|
-
tracks: [
|
|
2037
|
-
{
|
|
2038
|
-
name: 'Genes',
|
|
2039
|
-
type: 'annotation',
|
|
2040
|
-
format: 'refGene',
|
|
2041
|
-
url: 'https://api.genome.ucsc.edu/getData/track?genome=macFas5&track=refGene',
|
|
2042
|
-
},
|
|
2043
|
-
{
|
|
2044
|
-
name: 'Aligned Reads',
|
|
2045
|
-
type: 'alignment',
|
|
2046
|
-
format: 'bam',
|
|
2047
|
-
url: bam_url,
|
|
2048
|
-
indexURL: `${bam_url}.bai`,
|
|
2049
|
-
height: 500,
|
|
2050
|
-
},
|
|
2051
|
-
],
|
|
2052
|
-
};
|
|
2053
|
-
|
|
2054
|
-
igv.createBrowser(containerRef.current, options);
|
|
2055
|
-
}, [bam_url, region]);
|
|
2056
|
-
|
|
2057
|
-
return <div ref={containerRef} style={{ height: '800px' }} />;
|
|
2058
|
-
}
|
|
2059
|
-
```
|
|
2060
|
-
|
|
2061
|
-
---
|
|
2062
|
-
|
|
2063
|
-
## 7. Security & Authentication
|
|
2064
|
-
|
|
2065
|
-
### 7.1 OAuth2 Authentication Flow
|
|
2066
|
-
|
|
2067
|
-
**Architecture**:
|
|
2068
|
-
|
|
2069
|
-
```
|
|
2070
|
-
┌────────────┐ ┌────────────┐
|
|
2071
|
-
│ Client │ │ API │
|
|
2072
|
-
│ (React) │ │ Gateway │
|
|
2073
|
-
└─────┬──────┘ └─────┬──────┘
|
|
2074
|
-
│ │
|
|
2075
|
-
│ 1. POST /api/v1/auth/login │
|
|
2076
|
-
│ { email, password } │
|
|
2077
|
-
├────────────────────────────────────────────────────>│
|
|
2078
|
-
│ │ 2. Validate credentials
|
|
2079
|
-
│ │ (PostgreSQL)
|
|
2080
|
-
│ │
|
|
2081
|
-
│ 3. Response │
|
|
2082
|
-
│ { token, refresh_token, user } │
|
|
2083
|
-
│<────────────────────────────────────────────────────┤
|
|
2084
|
-
│ │
|
|
2085
|
-
│ 4. Store tokens in localStorage │
|
|
2086
|
-
│ │
|
|
2087
|
-
│ 5. API Request with Authorization header │
|
|
2088
|
-
│ Authorization: Bearer <JWT> │
|
|
2089
|
-
├────────────────────────────────────────────────────>│
|
|
2090
|
-
│ │ 6. Validate JWT
|
|
2091
|
-
│ │ (check signature, expiry)
|
|
2092
|
-
│ │
|
|
2093
|
-
│ │ 7. Check permissions
|
|
2094
|
-
│ │ (RBAC from JWT claims)
|
|
2095
|
-
│ │
|
|
2096
|
-
│ 8. Response │
|
|
2097
|
-
│<────────────────────────────────────────────────────┤
|
|
2098
|
-
│ │
|
|
2099
|
-
│ 9. Token expired (401) │
|
|
2100
|
-
│<────────────────────────────────────────────────────┤
|
|
2101
|
-
│ │
|
|
2102
|
-
│ 10. POST /api/v1/auth/refresh │
|
|
2103
|
-
│ { refresh_token } │
|
|
2104
|
-
├────────────────────────────────────────────────────>│
|
|
2105
|
-
│ │ 11. Validate refresh token
|
|
2106
|
-
│ │
|
|
2107
|
-
│ 12. New tokens │
|
|
2108
|
-
│ { token, refresh_token } │
|
|
2109
|
-
│<────────────────────────────────────────────────────┤
|
|
2110
|
-
│ │
|
|
2111
|
-
```
|
|
2112
|
-
|
|
2113
|
-
**JWT Token Structure**:
|
|
2114
|
-
|
|
2115
|
-
```json
|
|
2116
|
-
{
|
|
2117
|
-
"header": {
|
|
2118
|
-
"alg": "RS256",
|
|
2119
|
-
"typ": "JWT"
|
|
2120
|
-
},
|
|
2121
|
-
"payload": {
|
|
2122
|
-
"sub": "550e8400-e29b-41d4-a716-446655440000", // user ID
|
|
2123
|
-
"email": "researcher@example.com",
|
|
2124
|
-
"role": "researcher",
|
|
2125
|
-
"permissions": [
|
|
2126
|
-
"experiments:read",
|
|
2127
|
-
"experiments:create",
|
|
2128
|
-
"jobs:submit",
|
|
2129
|
-
"results:read"
|
|
2130
|
-
],
|
|
2131
|
-
"iat": 1705401600, // issued at (Unix timestamp)
|
|
2132
|
-
"exp": 1705488000 // expires at (24 hours later)
|
|
2133
|
-
},
|
|
2134
|
-
"signature": "..."
|
|
2135
|
-
}
|
|
2136
|
-
```
|
|
2137
|
-
|
|
2138
|
-
**Token Storage** (Frontend):
|
|
2139
|
-
- **Access Token**: `localStorage.setItem('access_token', token)`
|
|
2140
|
-
- **Refresh Token**: `httpOnly` cookie (more secure, prevents XSS)
|
|
2141
|
-
- **Auto-refresh**: Axios interceptor detects 401, refreshes token, retries request
|
|
2142
|
-
|
|
2143
|
-
---
|
|
2144
|
-
|
|
2145
|
-
### 7.2 Role-Based Access Control (RBAC)
|
|
2146
|
-
|
|
2147
|
-
**Roles**:
|
|
2148
|
-
|
|
2149
|
-
| Role | Permissions | Description |
|
|
2150
|
-
|------|-------------|-------------|
|
|
2151
|
-
| **Guest** | `experiments:read`, `results:read` | Read-only access to public experiments |
|
|
2152
|
-
| **Researcher** | `experiments:*`, `jobs:submit`, `results:*` | Create experiments, submit jobs, view results |
|
|
2153
|
-
| **Bioinformatician** | All researcher permissions + `pipelines:configure`, `data:export` | Configure analysis pipelines, export raw data |
|
|
2154
|
-
| **Admin** | `*:*` | Full system access, user management |
|
|
2155
|
-
|
|
2156
|
-
**Permission Enforcement** (Middleware):
|
|
2157
|
-
|
|
2158
|
-
```rust
|
|
2159
|
-
// src/middleware/auth.rs
|
|
2160
|
-
use axum::{http::{Request, StatusCode}, middleware::Next, response::Response};
|
|
2161
|
-
use jsonwebtoken::{decode, DecodingKey, Validation};
|
|
2162
|
-
|
|
2163
|
-
pub async fn auth_middleware<B>(
|
|
2164
|
-
request: Request<B>,
|
|
2165
|
-
next: Next<B>,
|
|
2166
|
-
) -> Result<Response, StatusCode> {
|
|
2167
|
-
// Extract Authorization header
|
|
2168
|
-
let auth_header = request
|
|
2169
|
-
.headers()
|
|
2170
|
-
.get("Authorization")
|
|
2171
|
-
.and_then(|h| h.to_str().ok())
|
|
2172
|
-
.ok_or(StatusCode::UNAUTHORIZED)?;
|
|
2173
|
-
|
|
2174
|
-
// Parse Bearer token
|
|
2175
|
-
let token = auth_header
|
|
2176
|
-
.strip_prefix("Bearer ")
|
|
2177
|
-
.ok_or(StatusCode::UNAUTHORIZED)?;
|
|
2178
|
-
|
|
2179
|
-
// Decode and validate JWT
|
|
2180
|
-
let key = DecodingKey::from_secret(std::env::var("JWT_SECRET").unwrap().as_bytes());
|
|
2181
|
-
let validation = Validation::default();
|
|
2182
|
-
|
|
2183
|
-
let token_data = decode::<Claims>(token, &key, &validation)
|
|
2184
|
-
.map_err(|_| StatusCode::UNAUTHORIZED)?;
|
|
2185
|
-
|
|
2186
|
-
// Check required permission (extract from route metadata)
|
|
2187
|
-
let required_permission = extract_required_permission(&request);
|
|
2188
|
-
if !has_permission(&token_data.claims, required_permission) {
|
|
2189
|
-
return Err(StatusCode::FORBIDDEN);
|
|
2190
|
-
}
|
|
2191
|
-
|
|
2192
|
-
// Inject user claims into request extensions
|
|
2193
|
-
request.extensions_mut().insert(token_data.claims);
|
|
2194
|
-
|
|
2195
|
-
Ok(next.run(request).await)
|
|
2196
|
-
}
|
|
2197
|
-
|
|
2198
|
-
fn has_permission(claims: &Claims, required: &str) -> bool {
|
|
2199
|
-
claims.permissions.iter().any(|p| p == required || p == "*:*")
|
|
2200
|
-
}
|
|
2201
|
-
```
|
|
2202
|
-
|
|
2203
|
-
**Route-Level Permissions** (declarative):
|
|
2204
|
-
|
|
2205
|
-
```rust
|
|
2206
|
-
Router::new()
|
|
2207
|
-
.route("/api/v1/experiments", post(create_experiment))
|
|
2208
|
-
.layer(require_permission("experiments:create"))
|
|
2209
|
-
|
|
2210
|
-
.route("/api/v1/admin/users", get(list_users))
|
|
2211
|
-
.layer(require_permission("admin:users:read"))
|
|
2212
|
-
```
|
|
2213
|
-
|
|
2214
|
-
---
|
|
2215
|
-
|
|
2216
|
-
### 7.3 Data Encryption
|
|
2217
|
-
|
|
2218
|
-
**At Rest**:
|
|
2219
|
-
- **PostgreSQL**: Transparent Data Encryption (TDE) with AES-256
|
|
2220
|
-
- **MongoDB**: Encrypted storage engine with key rotation
|
|
2221
|
-
- **MinIO**: Server-side encryption (SSE-S3) with AWS KMS
|
|
2222
|
-
|
|
2223
|
-
**In Transit**:
|
|
2224
|
-
- **External**: TLS 1.3 with certificate pinning
|
|
2225
|
-
- **Internal (service-to-service)**: Mutual TLS (mTLS) with Istio service mesh
|
|
2226
|
-
|
|
2227
|
-
**Secrets Management**:
|
|
2228
|
-
- **Kubernetes Secrets**: Base64-encoded (encrypted at rest by etcd)
|
|
2229
|
-
- **External Secrets Operator**: Sync from AWS Secrets Manager / HashiCorp Vault
|
|
2230
|
-
- **Rotation Policy**: Database credentials rotated every 90 days
|
|
2231
|
-
|
|
2232
|
-
---
|
|
2233
|
-
|
|
2234
|
-
### 7.4 Security Best Practices
|
|
2235
|
-
|
|
2236
|
-
1. **Input Validation**: All user inputs sanitized to prevent SQL injection, XSS
|
|
2237
|
-
2. **Rate Limiting**: Prevent brute-force attacks and API abuse
|
|
2238
|
-
3. **Audit Logging**: All sensitive operations logged (login, data access, exports)
|
|
2239
|
-
4. **Least Privilege**: Services run with minimal permissions
|
|
2240
|
-
5. **Vulnerability Scanning**: Automated container scanning (Trivy, Snyk)
|
|
2241
|
-
6. **Penetration Testing**: Annual third-party security audits
|
|
2242
|
-
7. **HIPAA Compliance**: Encrypted data, access logs, BAAs with cloud providers
|
|
2243
|
-
|
|
2244
|
-
---
|
|
2245
|
-
|
|
2246
|
-
## 8. Monitoring & Observability
|
|
2247
|
-
|
|
2248
|
-
### 8.1 Prometheus Metrics Collection
|
|
2249
|
-
|
|
2250
|
-
**Metrics Exposed by Each Service**:
|
|
2251
|
-
|
|
2252
|
-
```rust
|
|
2253
|
-
// Example: Axum API metrics
|
|
2254
|
-
use prometheus::{Encoder, TextEncoder, Counter, Histogram, register_counter, register_histogram};
|
|
2255
|
-
|
|
2256
|
-
lazy_static! {
|
|
2257
|
-
static ref HTTP_REQUESTS_TOTAL: Counter = register_counter!(
|
|
2258
|
-
"http_requests_total",
|
|
2259
|
-
"Total HTTP requests"
|
|
2260
|
-
).unwrap();
|
|
2261
|
-
|
|
2262
|
-
static ref HTTP_REQUEST_DURATION: Histogram = register_histogram!(
|
|
2263
|
-
"http_request_duration_seconds",
|
|
2264
|
-
"HTTP request latency"
|
|
2265
|
-
).unwrap();
|
|
2266
|
-
|
|
2267
|
-
static ref JOBS_SUBMITTED_TOTAL: Counter = register_counter!(
|
|
2268
|
-
"jobs_submitted_total",
|
|
2269
|
-
"Total jobs submitted"
|
|
2270
|
-
).unwrap();
|
|
2271
|
-
|
|
2272
|
-
static ref JOBS_COMPLETED_TOTAL: Counter = register_counter!(
|
|
2273
|
-
"jobs_completed_total",
|
|
2274
|
-
"Total jobs completed"
|
|
2275
|
-
).unwrap();
|
|
2276
|
-
}
|
|
2277
|
-
|
|
2278
|
-
async fn metrics_handler() -> String {
|
|
2279
|
-
let encoder = TextEncoder::new();
|
|
2280
|
-
let metric_families = prometheus::gather();
|
|
2281
|
-
let mut buffer = vec![];
|
|
2282
|
-
encoder.encode(&metric_families, &mut buffer).unwrap();
|
|
2283
|
-
String::from_utf8(buffer).unwrap()
|
|
2284
|
-
}
|
|
2285
|
-
```
|
|
2286
|
-
|
|
2287
|
-
**Prometheus Scrape Configuration** (see `monitoring/prometheus.yml`):
|
|
2288
|
-
|
|
2289
|
-
```yaml
|
|
2290
|
-
global:
|
|
2291
|
-
scrape_interval: 15s
|
|
2292
|
-
evaluation_interval: 15s
|
|
2293
|
-
|
|
2294
|
-
scrape_configs:
|
|
2295
|
-
- job_name: 'api-gateway'
|
|
2296
|
-
kubernetes_sd_configs:
|
|
2297
|
-
- role: pod
|
|
2298
|
-
namespaces:
|
|
2299
|
-
names:
|
|
2300
|
-
- crispr-production
|
|
2301
|
-
relabel_configs:
|
|
2302
|
-
- source_labels: [__meta_kubernetes_pod_label_app]
|
|
2303
|
-
regex: api-gateway
|
|
2304
|
-
action: keep
|
|
2305
|
-
metrics_path: /metrics
|
|
2306
|
-
|
|
2307
|
-
- job_name: 'alignment-service'
|
|
2308
|
-
kubernetes_sd_configs:
|
|
2309
|
-
- role: pod
|
|
2310
|
-
namespaces:
|
|
2311
|
-
names:
|
|
2312
|
-
- crispr-production
|
|
2313
|
-
relabel_configs:
|
|
2314
|
-
- source_labels: [__meta_kubernetes_pod_label_app]
|
|
2315
|
-
regex: alignment-service
|
|
2316
|
-
action: keep
|
|
2317
|
-
metrics_path: /metrics
|
|
2318
|
-
|
|
2319
|
-
- job_name: 'postgresql'
|
|
2320
|
-
static_configs:
|
|
2321
|
-
- targets: ['postgres-exporter:9187']
|
|
2322
|
-
|
|
2323
|
-
- job_name: 'kafka'
|
|
2324
|
-
static_configs:
|
|
2325
|
-
- targets: ['kafka-exporter:9308']
|
|
2326
|
-
|
|
2327
|
-
- job_name: 'kubernetes-nodes'
|
|
2328
|
-
kubernetes_sd_configs:
|
|
2329
|
-
- role: node
|
|
2330
|
-
```
|
|
2331
|
-
|
|
2332
|
-
---
|
|
2333
|
-
|
|
2334
|
-
### 8.2 Grafana Dashboards
|
|
2335
|
-
|
|
2336
|
-
**Dashboard 1: System Overview**
|
|
2337
|
-
|
|
2338
|
-
- **Total Experiments**: Gauge (current count)
|
|
2339
|
-
- **Jobs Submitted Today**: Counter
|
|
2340
|
-
- **Jobs Completed/Failed**: Pie chart
|
|
2341
|
-
- **API Request Rate**: Line graph (requests/sec)
|
|
2342
|
-
- **API P95 Latency**: Line graph
|
|
2343
|
-
- **Database Connection Pool Usage**: Gauge
|
|
2344
|
-
- **Kafka Consumer Lag**: Line graph per topic
|
|
2345
|
-
|
|
2346
|
-
**Dashboard 2: Processing Pipeline**
|
|
2347
|
-
|
|
2348
|
-
- **Active Jobs by Type**: Bar chart (alignment, off-target, diff-expr)
|
|
2349
|
-
- **Average Job Duration**: Line graph per job type
|
|
2350
|
-
- **Worker CPU/Memory Usage**: Heatmap per pod
|
|
2351
|
-
- **Queue Depth**: Line graph per Kafka topic
|
|
2352
|
-
- **Success Rate**: Gauge (completed / total)
|
|
2353
|
-
|
|
2354
|
-
**Dashboard 3: Resource Utilization**
|
|
2355
|
-
|
|
2356
|
-
- **Kubernetes Cluster CPU/Memory**: Line graph
|
|
2357
|
-
- **Node CPU/Memory per Node**: Heatmap
|
|
2358
|
-
- **Storage Usage** (PostgreSQL, MongoDB, MinIO): Gauge
|
|
2359
|
-
- **Network Throughput**: Line graph (ingress/egress)
|
|
2360
|
-
|
|
2361
|
-
**Grafana Configuration** (see `monitoring/grafana-dashboard.json`):
|
|
2362
|
-
|
|
2363
|
-
```json
|
|
2364
|
-
{
|
|
2365
|
-
"dashboard": {
|
|
2366
|
-
"title": "CRISPR-Cas13 Pipeline - System Overview",
|
|
2367
|
-
"panels": [
|
|
2368
|
-
{
|
|
2369
|
-
"id": 1,
|
|
2370
|
-
"title": "API Request Rate",
|
|
2371
|
-
"targets": [
|
|
2372
|
-
{
|
|
2373
|
-
"expr": "rate(http_requests_total[5m])",
|
|
2374
|
-
"legendFormat": "{{method}} {{path}}"
|
|
2375
|
-
}
|
|
2376
|
-
],
|
|
2377
|
-
"type": "graph"
|
|
2378
|
-
},
|
|
2379
|
-
{
|
|
2380
|
-
"id": 2,
|
|
2381
|
-
"title": "Jobs Submitted Today",
|
|
2382
|
-
"targets": [
|
|
2383
|
-
{
|
|
2384
|
-
"expr": "increase(jobs_submitted_total[1d])"
|
|
2385
|
-
}
|
|
2386
|
-
],
|
|
2387
|
-
"type": "singlestat"
|
|
2388
|
-
}
|
|
2389
|
-
]
|
|
2390
|
-
}
|
|
2391
|
-
}
|
|
2392
|
-
```
|
|
2393
|
-
|
|
2394
|
-
---
|
|
2395
|
-
|
|
2396
|
-
### 8.3 Distributed Tracing (Jaeger)
|
|
2397
|
-
|
|
2398
|
-
**Why Distributed Tracing?**
|
|
2399
|
-
- Visualize request flow across microservices
|
|
2400
|
-
- Identify performance bottlenecks
|
|
2401
|
-
- Debug complex failures in distributed systems
|
|
2402
|
-
|
|
2403
|
-
**OpenTelemetry Integration** (Rust):
|
|
2404
|
-
|
|
2405
|
-
```rust
|
|
2406
|
-
use opentelemetry::{global, sdk::trace::Tracer};
|
|
2407
|
-
use opentelemetry_jaeger::JaegerPipeline;
|
|
2408
|
-
use tracing_subscriber::layer::SubscriberExt;
|
|
2409
|
-
|
|
2410
|
-
fn init_tracing() {
|
|
2411
|
-
let tracer: Tracer = JaegerPipeline::default()
|
|
2412
|
-
.with_service_name("api-gateway")
|
|
2413
|
-
.with_agent_endpoint("jaeger-agent:6831")
|
|
2414
|
-
.install_batch(opentelemetry::runtime::Tokio)
|
|
2415
|
-
.expect("Failed to install Jaeger tracer");
|
|
2416
|
-
|
|
2417
|
-
let telemetry = tracing_opentelemetry::layer().with_tracer(tracer);
|
|
2418
|
-
let subscriber = tracing_subscriber::Registry::default().with(telemetry);
|
|
2419
|
-
|
|
2420
|
-
tracing::subscriber::set_global_default(subscriber)
|
|
2421
|
-
.expect("Failed to set subscriber");
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
|
-
#[tracing::instrument]
|
|
2425
|
-
async fn submit_job(job: Job) -> Result<String, ApiError> {
|
|
2426
|
-
// This function will automatically create a span in Jaeger
|
|
2427
|
-
// with function name, arguments, and return value
|
|
2428
|
-
|
|
2429
|
-
let span = tracing::info_span!("submit_job", job_id = %job.id);
|
|
2430
|
-
let _enter = span.enter();
|
|
2431
|
-
|
|
2432
|
-
// ... implementation
|
|
2433
|
-
}
|
|
2434
|
-
```
|
|
2435
|
-
|
|
2436
|
-
**Trace Visualization** (example span hierarchy):
|
|
2437
|
-
```
|
|
2438
|
-
POST /api/v1/jobs (200ms)
|
|
2439
|
-
├── validate_request (5ms)
|
|
2440
|
-
├── query_database (50ms)
|
|
2441
|
-
│ └── SELECT * FROM experiments (45ms)
|
|
2442
|
-
├── publish_to_kafka (100ms)
|
|
2443
|
-
│ ├── serialize_message (10ms)
|
|
2444
|
-
│ └── kafka_send (90ms)
|
|
2445
|
-
└── update_cache (45ms)
|
|
2446
|
-
└── redis_set (40ms)
|
|
2447
|
-
```
|
|
2448
|
-
|
|
2449
|
-
---
|
|
2450
|
-
|
|
2451
|
-
### 8.4 Alerting Rules
|
|
2452
|
-
|
|
2453
|
-
**Prometheus Alerting Rules** (see `monitoring/alerts.yml`):
|
|
2454
|
-
|
|
2455
|
-
```yaml
|
|
2456
|
-
groups:
|
|
2457
|
-
- name: crispr_pipeline_alerts
|
|
2458
|
-
interval: 30s
|
|
2459
|
-
rules:
|
|
2460
|
-
# High API error rate
|
|
2461
|
-
- alert: HighAPIErrorRate
|
|
2462
|
-
expr: rate(http_requests_total{status=~"5.."}[5m]) > 0.05
|
|
2463
|
-
for: 5m
|
|
2464
|
-
labels:
|
|
2465
|
-
severity: critical
|
|
2466
|
-
annotations:
|
|
2467
|
-
summary: "High API error rate detected"
|
|
2468
|
-
description: "API error rate is {{ $value | humanizePercentage }} (threshold: 5%)"
|
|
2469
|
-
|
|
2470
|
-
# High Kafka consumer lag
|
|
2471
|
-
- alert: HighKafkaConsumerLag
|
|
2472
|
-
expr: kafka_consumer_lag > 1000
|
|
2473
|
-
for: 10m
|
|
2474
|
-
labels:
|
|
2475
|
-
severity: warning
|
|
2476
|
-
annotations:
|
|
2477
|
-
summary: "Kafka consumer lag is high"
|
|
2478
|
-
description: "Topic {{ $labels.topic }} has {{ $value }} messages in lag"
|
|
2479
|
-
|
|
2480
|
-
# Database connection pool exhaustion
|
|
2481
|
-
- alert: DatabaseConnectionPoolExhausted
|
|
2482
|
-
expr: database_connection_pool_active / database_connection_pool_max > 0.9
|
|
2483
|
-
for: 5m
|
|
2484
|
-
labels:
|
|
2485
|
-
severity: critical
|
|
2486
|
-
annotations:
|
|
2487
|
-
summary: "Database connection pool nearly exhausted"
|
|
2488
|
-
description: "{{ $value | humanizePercentage }} of connections are in use"
|
|
2489
|
-
|
|
2490
|
-
# Long-running jobs
|
|
2491
|
-
- alert: JobRunningTooLong
|
|
2492
|
-
expr: time() - job_started_timestamp > 3600 * 6 # 6 hours
|
|
2493
|
-
for: 0m
|
|
2494
|
-
labels:
|
|
2495
|
-
severity: warning
|
|
2496
|
-
annotations:
|
|
2497
|
-
summary: "Job {{ $labels.job_id }} has been running for over 6 hours"
|
|
2498
|
-
|
|
2499
|
-
# Disk space low
|
|
2500
|
-
- alert: DiskSpaceLow
|
|
2501
|
-
expr: node_filesystem_avail_bytes / node_filesystem_size_bytes < 0.1
|
|
2502
|
-
for: 5m
|
|
2503
|
-
labels:
|
|
2504
|
-
severity: critical
|
|
2505
|
-
annotations:
|
|
2506
|
-
summary: "Disk space below 10% on {{ $labels.instance }}"
|
|
2507
|
-
```
|
|
2508
|
-
|
|
2509
|
-
**Alert Routing** (Alertmanager):
|
|
2510
|
-
- **Critical**: PagerDuty (24/7 on-call)
|
|
2511
|
-
- **Warning**: Slack #crispr-alerts channel
|
|
2512
|
-
- **Info**: Email to dev team
|
|
2513
|
-
|
|
2514
|
-
---
|
|
2515
|
-
|
|
2516
|
-
## 9. Deployment Strategy
|
|
2517
|
-
|
|
2518
|
-
### 9.1 Kubernetes Deployment Manifests
|
|
2519
|
-
|
|
2520
|
-
**Namespace** (deployment/namespace.yaml):
|
|
2521
|
-
```yaml
|
|
2522
|
-
apiVersion: v1
|
|
2523
|
-
kind: Namespace
|
|
2524
|
-
metadata:
|
|
2525
|
-
name: crispr-production
|
|
2526
|
-
labels:
|
|
2527
|
-
name: crispr-production
|
|
2528
|
-
```
|
|
2529
|
-
|
|
2530
|
-
**API Gateway Deployment** (deployment/api-gateway.yaml):
|
|
2531
|
-
```yaml
|
|
2532
|
-
apiVersion: apps/v1
|
|
2533
|
-
kind: Deployment
|
|
2534
|
-
metadata:
|
|
2535
|
-
name: api-gateway
|
|
2536
|
-
namespace: crispr-production
|
|
2537
|
-
spec:
|
|
2538
|
-
replicas: 3
|
|
2539
|
-
selector:
|
|
2540
|
-
matchLabels:
|
|
2541
|
-
app: api-gateway
|
|
2542
|
-
template:
|
|
2543
|
-
metadata:
|
|
2544
|
-
labels:
|
|
2545
|
-
app: api-gateway
|
|
2546
|
-
spec:
|
|
2547
|
-
containers:
|
|
2548
|
-
- name: api-gateway
|
|
2549
|
-
image: crispr-registry.io/api-gateway:v1.0.0
|
|
2550
|
-
ports:
|
|
2551
|
-
- containerPort: 3000
|
|
2552
|
-
env:
|
|
2553
|
-
- name: DATABASE_URL
|
|
2554
|
-
valueFrom:
|
|
2555
|
-
secretKeyRef:
|
|
2556
|
-
name: database-credentials
|
|
2557
|
-
key: url
|
|
2558
|
-
- name: REDIS_URL
|
|
2559
|
-
valueFrom:
|
|
2560
|
-
secretKeyRef:
|
|
2561
|
-
name: redis-credentials
|
|
2562
|
-
key: url
|
|
2563
|
-
- name: KAFKA_BROKERS
|
|
2564
|
-
value: "kafka-0.kafka:9092,kafka-1.kafka:9092,kafka-2.kafka:9092"
|
|
2565
|
-
- name: JWT_SECRET
|
|
2566
|
-
valueFrom:
|
|
2567
|
-
secretKeyRef:
|
|
2568
|
-
name: jwt-secret
|
|
2569
|
-
key: secret
|
|
2570
|
-
resources:
|
|
2571
|
-
requests:
|
|
2572
|
-
cpu: "500m"
|
|
2573
|
-
memory: "1Gi"
|
|
2574
|
-
limits:
|
|
2575
|
-
cpu: "2"
|
|
2576
|
-
memory: "4Gi"
|
|
2577
|
-
livenessProbe:
|
|
2578
|
-
httpGet:
|
|
2579
|
-
path: /health
|
|
2580
|
-
port: 3000
|
|
2581
|
-
initialDelaySeconds: 30
|
|
2582
|
-
periodSeconds: 10
|
|
2583
|
-
readinessProbe:
|
|
2584
|
-
httpGet:
|
|
2585
|
-
path: /ready
|
|
2586
|
-
port: 3000
|
|
2587
|
-
initialDelaySeconds: 5
|
|
2588
|
-
periodSeconds: 5
|
|
2589
|
-
---
|
|
2590
|
-
apiVersion: v1
|
|
2591
|
-
kind: Service
|
|
2592
|
-
metadata:
|
|
2593
|
-
name: api-gateway
|
|
2594
|
-
namespace: crispr-production
|
|
2595
|
-
spec:
|
|
2596
|
-
selector:
|
|
2597
|
-
app: api-gateway
|
|
2598
|
-
ports:
|
|
2599
|
-
- protocol: TCP
|
|
2600
|
-
port: 80
|
|
2601
|
-
targetPort: 3000
|
|
2602
|
-
type: ClusterIP
|
|
2603
|
-
---
|
|
2604
|
-
apiVersion: networking.k8s.io/v1
|
|
2605
|
-
kind: Ingress
|
|
2606
|
-
metadata:
|
|
2607
|
-
name: api-gateway-ingress
|
|
2608
|
-
namespace: crispr-production
|
|
2609
|
-
annotations:
|
|
2610
|
-
cert-manager.io/cluster-issuer: letsencrypt-prod
|
|
2611
|
-
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
|
2612
|
-
spec:
|
|
2613
|
-
ingressClassName: nginx
|
|
2614
|
-
tls:
|
|
2615
|
-
- hosts:
|
|
2616
|
-
- api.crispr.example.com
|
|
2617
|
-
secretName: api-gateway-tls
|
|
2618
|
-
rules:
|
|
2619
|
-
- host: api.crispr.example.com
|
|
2620
|
-
http:
|
|
2621
|
-
paths:
|
|
2622
|
-
- path: /
|
|
2623
|
-
pathType: Prefix
|
|
2624
|
-
backend:
|
|
2625
|
-
service:
|
|
2626
|
-
name: api-gateway
|
|
2627
|
-
port:
|
|
2628
|
-
number: 80
|
|
2629
|
-
```
|
|
2630
|
-
|
|
2631
|
-
**Alignment Service Deployment** (deployment/alignment-service.yaml):
|
|
2632
|
-
```yaml
|
|
2633
|
-
apiVersion: apps/v1
|
|
2634
|
-
kind: Deployment
|
|
2635
|
-
metadata:
|
|
2636
|
-
name: alignment-service
|
|
2637
|
-
namespace: crispr-production
|
|
2638
|
-
spec:
|
|
2639
|
-
replicas: 5
|
|
2640
|
-
selector:
|
|
2641
|
-
matchLabels:
|
|
2642
|
-
app: alignment-service
|
|
2643
|
-
template:
|
|
2644
|
-
metadata:
|
|
2645
|
-
labels:
|
|
2646
|
-
app: alignment-service
|
|
2647
|
-
spec:
|
|
2648
|
-
affinity:
|
|
2649
|
-
nodeAffinity:
|
|
2650
|
-
requiredDuringSchedulingIgnoredDuringExecution:
|
|
2651
|
-
nodeSelectorTerms:
|
|
2652
|
-
- matchExpressions:
|
|
2653
|
-
- key: node-role
|
|
2654
|
-
operator: In
|
|
2655
|
-
values:
|
|
2656
|
-
- compute-intensive
|
|
2657
|
-
containers:
|
|
2658
|
-
- name: alignment-worker
|
|
2659
|
-
image: crispr-registry.io/alignment-service:v1.0.0
|
|
2660
|
-
env:
|
|
2661
|
-
- name: KAFKA_BROKERS
|
|
2662
|
-
value: "kafka-0.kafka:9092,kafka-1.kafka:9092,kafka-2.kafka:9092"
|
|
2663
|
-
- name: MINIO_ENDPOINT
|
|
2664
|
-
value: "http://minio:9000"
|
|
2665
|
-
- name: MINIO_ACCESS_KEY
|
|
2666
|
-
valueFrom:
|
|
2667
|
-
secretKeyRef:
|
|
2668
|
-
name: minio-credentials
|
|
2669
|
-
key: access_key
|
|
2670
|
-
- name: MINIO_SECRET_KEY
|
|
2671
|
-
valueFrom:
|
|
2672
|
-
secretKeyRef:
|
|
2673
|
-
name: minio-credentials
|
|
2674
|
-
key: secret_key
|
|
2675
|
-
resources:
|
|
2676
|
-
requests:
|
|
2677
|
-
cpu: "4"
|
|
2678
|
-
memory: "16Gi"
|
|
2679
|
-
limits:
|
|
2680
|
-
cpu: "8"
|
|
2681
|
-
memory: "32Gi"
|
|
2682
|
-
```
|
|
2683
|
-
|
|
2684
|
-
---
|
|
2685
|
-
|
|
2686
|
-
### 9.2 CI/CD Pipeline
|
|
2687
|
-
|
|
2688
|
-
**GitHub Actions Workflow** (.github/workflows/deploy.yml):
|
|
2689
|
-
|
|
2690
|
-
```yaml
|
|
2691
|
-
name: Deploy to Production
|
|
2692
|
-
|
|
2693
|
-
on:
|
|
2694
|
-
push:
|
|
2695
|
-
branches:
|
|
2696
|
-
- main
|
|
2697
|
-
|
|
2698
|
-
jobs:
|
|
2699
|
-
test:
|
|
2700
|
-
runs-on: ubuntu-latest
|
|
2701
|
-
steps:
|
|
2702
|
-
- uses: actions/checkout@v3
|
|
2703
|
-
|
|
2704
|
-
- name: Run tests
|
|
2705
|
-
run: |
|
|
2706
|
-
cd api && cargo test
|
|
2707
|
-
cd ../frontend && npm test
|
|
2708
|
-
|
|
2709
|
-
build:
|
|
2710
|
-
needs: test
|
|
2711
|
-
runs-on: ubuntu-latest
|
|
2712
|
-
steps:
|
|
2713
|
-
- uses: actions/checkout@v3
|
|
2714
|
-
|
|
2715
|
-
- name: Build Docker images
|
|
2716
|
-
run: |
|
|
2717
|
-
docker build -t crispr-registry.io/api-gateway:${{ github.sha }} api/
|
|
2718
|
-
docker build -t crispr-registry.io/alignment-service:${{ github.sha }} docker/alignment-service/
|
|
2719
|
-
docker build -t crispr-registry.io/off-target-service:${{ github.sha }} docker/off-target-service/
|
|
2720
|
-
docker build -t crispr-registry.io/diff-expr-service:${{ github.sha }} docker/diff-expr-service/
|
|
2721
|
-
|
|
2722
|
-
- name: Push to registry
|
|
2723
|
-
run: |
|
|
2724
|
-
echo ${{ secrets.REGISTRY_PASSWORD }} | docker login -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin crispr-registry.io
|
|
2725
|
-
docker push crispr-registry.io/api-gateway:${{ github.sha }}
|
|
2726
|
-
docker push crispr-registry.io/alignment-service:${{ github.sha }}
|
|
2727
|
-
docker push crispr-registry.io/off-target-service:${{ github.sha }}
|
|
2728
|
-
docker push crispr-registry.io/diff-expr-service:${{ github.sha }}
|
|
2729
|
-
|
|
2730
|
-
deploy:
|
|
2731
|
-
needs: build
|
|
2732
|
-
runs-on: ubuntu-latest
|
|
2733
|
-
steps:
|
|
2734
|
-
- uses: actions/checkout@v3
|
|
2735
|
-
|
|
2736
|
-
- name: Deploy to Kubernetes
|
|
2737
|
-
run: |
|
|
2738
|
-
kubectl set image deployment/api-gateway api-gateway=crispr-registry.io/api-gateway:${{ github.sha }} -n crispr-production
|
|
2739
|
-
kubectl set image deployment/alignment-service alignment-worker=crispr-registry.io/alignment-service:${{ github.sha }} -n crispr-production
|
|
2740
|
-
kubectl rollout status deployment/api-gateway -n crispr-production
|
|
2741
|
-
kubectl rollout status deployment/alignment-service -n crispr-production
|
|
2742
|
-
```
|
|
2743
|
-
|
|
2744
|
-
---
|
|
2745
|
-
|
|
2746
|
-
### 9.3 Blue-Green Deployment
|
|
2747
|
-
|
|
2748
|
-
**Strategy**: Maintain two identical production environments (blue/green), switch traffic atomically
|
|
2749
|
-
|
|
2750
|
-
```yaml
|
|
2751
|
-
# Blue deployment (current production)
|
|
2752
|
-
apiVersion: apps/v1
|
|
2753
|
-
kind: Deployment
|
|
2754
|
-
metadata:
|
|
2755
|
-
name: api-gateway-blue
|
|
2756
|
-
namespace: crispr-production
|
|
2757
|
-
spec:
|
|
2758
|
-
replicas: 3
|
|
2759
|
-
selector:
|
|
2760
|
-
matchLabels:
|
|
2761
|
-
app: api-gateway
|
|
2762
|
-
version: blue
|
|
2763
|
-
|
|
2764
|
-
# Green deployment (new version)
|
|
2765
|
-
apiVersion: apps/v1
|
|
2766
|
-
kind: Deployment
|
|
2767
|
-
metadata:
|
|
2768
|
-
name: api-gateway-green
|
|
2769
|
-
namespace: crispr-production
|
|
2770
|
-
spec:
|
|
2771
|
-
replicas: 3
|
|
2772
|
-
selector:
|
|
2773
|
-
matchLabels:
|
|
2774
|
-
app: api-gateway
|
|
2775
|
-
version: green
|
|
2776
|
-
|
|
2777
|
-
# Service (switch between blue/green by updating selector)
|
|
2778
|
-
apiVersion: v1
|
|
2779
|
-
kind: Service
|
|
2780
|
-
metadata:
|
|
2781
|
-
name: api-gateway
|
|
2782
|
-
namespace: crispr-production
|
|
2783
|
-
spec:
|
|
2784
|
-
selector:
|
|
2785
|
-
app: api-gateway
|
|
2786
|
-
version: blue # Change to "green" to switch traffic
|
|
2787
|
-
ports:
|
|
2788
|
-
- port: 80
|
|
2789
|
-
targetPort: 3000
|
|
2790
|
-
```
|
|
2791
|
-
|
|
2792
|
-
**Deployment Process**:
|
|
2793
|
-
1. Deploy green version (new code)
|
|
2794
|
-
2. Run smoke tests on green
|
|
2795
|
-
3. Update Service selector to `version: green`
|
|
2796
|
-
4. Monitor for 30 minutes (watch error rates, latencies)
|
|
2797
|
-
5. If successful, delete blue deployment
|
|
2798
|
-
6. If failed, rollback by switching Service selector back to `version: blue`
|
|
2799
|
-
|
|
2800
|
-
---
|
|
2801
|
-
|
|
2802
|
-
## 10. Technology Stack
|
|
2803
|
-
|
|
2804
|
-
### 10.1 Core Technologies
|
|
2805
|
-
|
|
2806
|
-
| Layer | Technology | Version | Justification |
|
|
2807
|
-
|-------|-----------|---------|---------------|
|
|
2808
|
-
| **API Layer** | Axum (Rust) | 0.7 | High performance, memory safety, strong typing |
|
|
2809
|
-
| | Tower (middleware) | 0.4 | Composable HTTP middleware |
|
|
2810
|
-
| | Tokio (async runtime) | 1.35 | Efficient async I/O |
|
|
2811
|
-
| **Processing Layer** | Python | 3.11 | Rich bioinformatics ecosystem (Biopython, NumPy) |
|
|
2812
|
-
| | R (Bioconductor) | 4.3 | Industry standard for genomics (DESeq2, edgeR) |
|
|
2813
|
-
| | Bowtie2 | 2.5.1 | Fast, memory-efficient short read aligner |
|
|
2814
|
-
| **Frontend** | React | 18 | Component-based UI, large ecosystem |
|
|
2815
|
-
| | TypeScript | 5.3 | Type safety, better developer experience |
|
|
2816
|
-
| | Vite | 5.0 | Fast builds, HMR |
|
|
2817
|
-
| | D3.js | 7.8 | Flexible data visualizations |
|
|
2818
|
-
| | IGV.js | 2.15 | Interactive genomic browser |
|
|
2819
|
-
| **Databases** | PostgreSQL | 16 | ACID compliance, complex queries, JSON support |
|
|
2820
|
-
| | MongoDB | 7.0 | Flexible schema for genomic annotations |
|
|
2821
|
-
| | Redis | 7.2 | High-performance caching, session storage |
|
|
2822
|
-
| | MinIO | RELEASE.2024-01 | S3-compatible object storage |
|
|
2823
|
-
| **Message Queue** | Apache Kafka | 3.6 | Fault-tolerant, high-throughput message queue |
|
|
2824
|
-
| **Orchestration** | Kubernetes | 1.28 | Container orchestration, auto-scaling |
|
|
2825
|
-
| | Helm | 3.13 | Kubernetes package manager |
|
|
2826
|
-
| **Monitoring** | Prometheus | 2.48 | Metrics collection, alerting |
|
|
2827
|
-
| | Grafana | 10.2 | Visualization, dashboards |
|
|
2828
|
-
| | Jaeger | 1.52 | Distributed tracing |
|
|
2829
|
-
| **CI/CD** | GitHub Actions | N/A | Automated testing, building, deployment |
|
|
2830
|
-
| | Docker | 24.0 | Container packaging |
|
|
2831
|
-
|
|
2832
|
-
---
|
|
2833
|
-
|
|
2834
|
-
### 10.2 Bioinformatics Tools
|
|
2835
|
-
|
|
2836
|
-
| Tool | Version | Purpose |
|
|
2837
|
-
|------|---------|---------|
|
|
2838
|
-
| Bowtie2 | 2.5.1 | Read alignment to reference genome |
|
|
2839
|
-
| Samtools | 1.17 | BAM file manipulation |
|
|
2840
|
-
| FastQC | 0.12.1 | Quality control of sequencing data |
|
|
2841
|
-
| MultiQC | 1.16 | Aggregate QC reports |
|
|
2842
|
-
| featureCounts | 2.0.3 | Count reads per gene (from Subread package) |
|
|
2843
|
-
| DESeq2 | 1.42 | Differential gene expression analysis |
|
|
2844
|
-
| edgeR | 3.44 | Alternative differential expression tool |
|
|
2845
|
-
| Biopython | 1.81 | Python library for sequence analysis |
|
|
2846
|
-
| PyTorch | 2.1 | Machine learning for off-target prediction |
|
|
2847
|
-
|
|
2848
|
-
---
|
|
2849
|
-
|
|
2850
|
-
## 11. Scalability & Performance
|
|
2851
|
-
|
|
2852
|
-
### 11.1 Performance Targets
|
|
2853
|
-
|
|
2854
|
-
| Metric | Target | Measurement |
|
|
2855
|
-
|--------|--------|-------------|
|
|
2856
|
-
| **API Latency** | P50 < 50ms, P95 < 200ms, P99 < 500ms | Prometheus histogram |
|
|
2857
|
-
| **Throughput** | 50-100 samples/day (200GB-1TB) | Job completion rate |
|
|
2858
|
-
| **Database Queries** | P95 < 100ms | PostgreSQL `pg_stat_statements` |
|
|
2859
|
-
| **Job Queue Latency** | Kafka consumer lag < 100 messages | Kafka exporter |
|
|
2860
|
-
| **Frontend Load Time** | First Contentful Paint < 1.5s | Lighthouse CI |
|
|
2861
|
-
| **Uptime** | 99.9% (8.7 hours downtime/year) | Prometheus uptime probe |
|
|
2862
|
-
|
|
2863
|
-
---
|
|
2864
|
-
|
|
2865
|
-
### 11.2 Scalability Strategies
|
|
2866
|
-
|
|
2867
|
-
#### 11.2.1 Horizontal Scaling
|
|
2868
|
-
|
|
2869
|
-
- **API Gateway**: 2-20 replicas (CPU-based HPA)
|
|
2870
|
-
- **Processing Workers**: 1-50 pods (queue-depth based HPA)
|
|
2871
|
-
- **Database Read Replicas**: 3 PostgreSQL replicas for read-heavy queries
|
|
2872
|
-
- **Kafka Partitions**: 10 partitions per topic (allows 10 parallel consumers)
|
|
2873
|
-
|
|
2874
|
-
#### 11.2.2 Caching Strategy
|
|
2875
|
-
|
|
2876
|
-
**Multi-layer caching**:
|
|
2877
|
-
|
|
2878
|
-
1. **CDN** (CloudFlare): Static assets (JS, CSS, images)
|
|
2879
|
-
2. **Browser**: HTTP cache headers for API responses
|
|
2880
|
-
3. **Redis**: Hot data (user sessions, recent experiments, job statuses)
|
|
2881
|
-
4. **Database Query Cache**: PostgreSQL `pg_prewarm` for frequently accessed tables
|
|
2882
|
-
|
|
2883
|
-
**Cache Invalidation**:
|
|
2884
|
-
- **TTL-based**: Most caches expire after 5-10 minutes
|
|
2885
|
-
- **Event-driven**: Kafka events trigger cache invalidation (e.g., job completion → invalidate job status cache)
|
|
2886
|
-
|
|
2887
|
-
#### 11.2.3 Database Optimization
|
|
2888
|
-
|
|
2889
|
-
**PostgreSQL**:
|
|
2890
|
-
- **Indexes**: Create indexes on frequently queried columns (user_id, experiment_id, status)
|
|
2891
|
-
- **Partitioning**: Partition `audit_log` table by month (improves query performance)
|
|
2892
|
-
- **Connection Pooling**: PgBouncer with 100 max connections
|
|
2893
|
-
- **VACUUM**: Automated weekly VACUUM ANALYZE to reclaim space
|
|
2894
|
-
|
|
2895
|
-
**MongoDB**:
|
|
2896
|
-
- **Sharding**: Shard `genes` collection by chromosome (24 shards)
|
|
2897
|
-
- **Indexes**: Compound indexes on `{gene_symbol: 1, chromosome: 1}`
|
|
2898
|
-
- **Aggregation Pipeline**: Use MongoDB aggregation for complex genomic queries
|
|
2899
|
-
|
|
2900
|
-
---
|
|
2901
|
-
|
|
2902
|
-
## 12. Trade-off Analysis
|
|
2903
|
-
|
|
2904
|
-
### 12.1 Architectural Decisions
|
|
2905
|
-
|
|
2906
|
-
| Decision | Alternatives Considered | Trade-offs | Rationale |
|
|
2907
|
-
|----------|-------------------------|------------|-----------|
|
|
2908
|
-
| **Rust for API** | Node.js, Go, Python | **Pro**: 10x performance, memory safety<br/>**Con**: Steeper learning curve, longer compile times | Performance critical for high-throughput API |
|
|
2909
|
-
| **Microservices** | Monolith | **Pro**: Independent scaling, fault isolation<br/>**Con**: Operational complexity, network overhead | Flexibility to scale each component independently |
|
|
2910
|
-
| **Kafka vs RabbitMQ** | RabbitMQ, AWS SQS | **Pro**: High throughput, log-based architecture<br/>**Con**: More complex setup | Kafka's replay capability useful for debugging |
|
|
2911
|
-
| **PostgreSQL + MongoDB** | PostgreSQL only | **Pro**: Best tool for each data type<br/>**Con**: Two databases to maintain | Flexible schema needed for genomic annotations |
|
|
2912
|
-
| **Kubernetes** | Docker Swarm, ECS | **Pro**: Industry standard, rich ecosystem<br/>**Con**: Steeper learning curve | Better auto-scaling, service mesh support |
|
|
2913
|
-
| **React** | Vue, Svelte | **Pro**: Largest ecosystem, more developers<br/>**Con**: Slightly larger bundle size | Better component library availability |
|
|
2914
|
-
|
|
2915
|
-
---
|
|
2916
|
-
|
|
2917
|
-
### 12.2 Cost-Performance Trade-offs
|
|
2918
|
-
|
|
2919
|
-
**Scenario**: Processing 100 samples/day
|
|
2920
|
-
|
|
2921
|
-
| Component | Configuration | Monthly Cost | Performance | Scalability |
|
|
2922
|
-
|-----------|---------------|--------------|-------------|-------------|
|
|
2923
|
-
| **Kubernetes Cluster** | 20 nodes (c5.4xlarge) | $8,000 | High | Excellent |
|
|
2924
|
-
| **PostgreSQL RDS** | db.r5.2xlarge (3 replicas) | $2,500 | High | Good |
|
|
2925
|
-
| **MongoDB Atlas** | M30 (3 shards) | $1,800 | High | Excellent |
|
|
2926
|
-
| **Redis ElastiCache** | cache.r5.xlarge (3 nodes) | $900 | High | Good |
|
|
2927
|
-
| **MinIO (S3)** | 50TB storage + transfer | $1,200 | High | Excellent |
|
|
2928
|
-
| **Kafka MSK** | kafka.m5.large (3 brokers) | $1,400 | High | Excellent |
|
|
2929
|
-
| **Total** | | **$15,800/month** | | |
|
|
2930
|
-
|
|
2931
|
-
**Cost Optimization Opportunities**:
|
|
2932
|
-
1. **Spot Instances**: Use spot instances for batch processing workers (50-70% cost savings)
|
|
2933
|
-
2. **S3 Lifecycle Policies**: Archive old data to Glacier (90% storage cost reduction)
|
|
2934
|
-
3. **Reserved Instances**: Commit to 1-year reserved instances for baseline capacity (30% discount)
|
|
2935
|
-
4. **Right-sizing**: Monitor resource usage, downsize over-provisioned services
|
|
2936
|
-
|
|
2937
|
-
---
|
|
2938
|
-
|
|
2939
|
-
## Conclusion
|
|
2940
|
-
|
|
2941
|
-
This architecture provides a **scalable, fault-tolerant, and secure** foundation for the CRISPR-Cas13 bioinformatics pipeline. Key highlights:
|
|
2942
|
-
|
|
2943
|
-
✅ **Microservices Architecture**: Independent scaling, fault isolation
|
|
2944
|
-
✅ **Multi-layer Data Strategy**: PostgreSQL (relational), MongoDB (genomic), Redis (cache), MinIO (objects)
|
|
2945
|
-
✅ **Kafka-based Job Orchestration**: Decoupled, fault-tolerant processing
|
|
2946
|
-
✅ **Rust API Layer**: High performance, memory safety
|
|
2947
|
-
✅ **React Frontend**: Modern, interactive UI with real-time updates
|
|
2948
|
-
✅ **Comprehensive Monitoring**: Prometheus, Grafana, Jaeger for observability
|
|
2949
|
-
✅ **Security-first Design**: OAuth2, RBAC, encryption at rest and in transit
|
|
2950
|
-
✅ **Cloud-native**: Kubernetes for orchestration, auto-scaling policies
|
|
2951
|
-
|
|
2952
|
-
**Next Steps** (SPARC Phase 4 - Refinement):
|
|
2953
|
-
1. Implement Test-Driven Development (TDD) for each component
|
|
2954
|
-
2. Create integration tests for end-to-end workflows
|
|
2955
|
-
3. Conduct load testing (Apache JMeter, k6) to validate performance targets
|
|
2956
|
-
4. Security audit and penetration testing
|
|
2957
|
-
5. Documentation: API reference, deployment guide, operational runbook
|
|
2958
|
-
|
|
2959
|
-
---
|
|
2960
|
-
|
|
2961
|
-
**Document Version**: 1.0
|
|
2962
|
-
**Last Updated**: 2025-10-12
|
|
2963
|
-
**Author**: Architecture Agent (SPARC Phase 3)
|
|
2964
|
-
**Review Status**: Ready for Technical Review
|