@genobank/biofs 1.8.1 → 1.8.3

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +120 -152
  2. package/dist/commands/biofiles.d.ts +9 -0
  3. package/dist/commands/biofiles.d.ts.map +1 -0
  4. package/dist/commands/biofiles.js +112 -0
  5. package/dist/commands/biofiles.js.map +1 -0
  6. package/dist/commands/labs/list.d.ts +19 -0
  7. package/dist/commands/labs/list.d.ts.map +1 -0
  8. package/dist/commands/labs/list.js +98 -0
  9. package/dist/commands/labs/list.js.map +1 -0
  10. package/dist/commands/share.d.ts +10 -0
  11. package/dist/commands/share.d.ts.map +1 -0
  12. package/dist/commands/share.js +186 -0
  13. package/dist/commands/share.js.map +1 -0
  14. package/dist/commands/verify.d.ts +9 -0
  15. package/dist/commands/verify.d.ts.map +1 -0
  16. package/dist/commands/verify.js +138 -0
  17. package/dist/commands/verify.js.map +1 -0
  18. package/dist/index.js +99 -45
  19. package/dist/index.js.map +1 -1
  20. package/dist/lib/ai/classifier.d.ts +1 -3
  21. package/dist/lib/ai/classifier.d.ts.map +1 -1
  22. package/dist/lib/ai/classifier.js +17 -37
  23. package/dist/lib/ai/classifier.js.map +1 -1
  24. package/dist/lib/api/client.d.ts +46 -0
  25. package/dist/lib/api/client.d.ts.map +1 -1
  26. package/dist/lib/api/client.js +159 -19
  27. package/dist/lib/api/client.js.map +1 -1
  28. package/dist/lib/auth/server.d.ts.map +1 -1
  29. package/dist/lib/auth/server.js +2 -11
  30. package/dist/lib/auth/server.js.map +1 -1
  31. package/dist/lib/biofiles/fingerprint.d.ts.map +1 -1
  32. package/dist/lib/biofiles/fingerprint.js +11 -40
  33. package/dist/lib/biofiles/fingerprint.js.map +1 -1
  34. package/dist/lib/biofiles/resolver.d.ts.map +1 -1
  35. package/dist/lib/biofiles/resolver.js +59 -75
  36. package/dist/lib/biofiles/resolver.js.map +1 -1
  37. package/dist/lib/config/constants.d.ts +1 -0
  38. package/dist/lib/config/constants.d.ts.map +1 -1
  39. package/dist/lib/config/constants.js +3 -3
  40. package/dist/lib/config/constants.js.map +1 -1
  41. package/dist/lib/utils/logger.d.ts +5 -6
  42. package/dist/lib/utils/logger.d.ts.map +1 -1
  43. package/dist/lib/utils/logger.js +5 -23
  44. package/dist/lib/utils/logger.js.map +1 -1
  45. package/dist/types/api.d.ts +21 -0
  46. package/dist/types/api.d.ts.map +1 -1
  47. package/dist/types/biofiles.d.ts +2 -2
  48. package/dist/types/biofiles.d.ts.map +1 -1
  49. package/package.json +2 -3
  50. package/.claude/settings.local.json +0 -33
  51. package/BIOFS_CLI_NODE_CONVERGENCE_ANALYSIS.md +0 -932
  52. package/BIOFS_FEDERATED_NETWORK_ARCHITECTURE.md +0 -1071
  53. package/BIOFS_NODE_CLIENT_ARCHITECTURE.md +0 -557
  54. package/BIOFS_NODE_IMPLEMENTATION_PLAN.md +0 -2164
  55. package/BIOROUTER_IMPLEMENTATION_CHECKLIST.md +0 -618
  56. package/BUBBLEWRAP_INTEGRATION.md +0 -486
  57. package/BUBBLEWRAP_QUICKSTART.md +0 -356
  58. package/BUBBLEWRAP_README.md +0 -466
  59. package/BUBBLEWRAP_STRATEGIC_ANALYSIS.md +0 -625
  60. package/EXECUTIVE_SUMMARY_BIOROUTER_CONVERGENCE.md +0 -323
  61. package/GEMINI_REMOVAL_COMPLETE.md +0 -311
  62. package/debug_credentials.js +0 -60
  63. package/dist/commands/sandbox.d.ts +0 -10
  64. package/dist/commands/sandbox.d.ts.map +0 -1
  65. package/dist/commands/sandbox.js +0 -418
  66. package/dist/commands/sandbox.js.map +0 -1
  67. package/dist/lib/sandbox/bubblewrap.d.ts +0 -125
  68. package/dist/lib/sandbox/bubblewrap.d.ts.map +0 -1
  69. package/dist/lib/sandbox/bubblewrap.js +0 -343
  70. package/dist/lib/sandbox/bubblewrap.js.map +0 -1
  71. package/examples/sandbox-usage.ts +0 -361
@@ -1,323 +0,0 @@
1
- # Executive Summary: BioFS CLI + Node Convergence for BioRouter Protocol
2
- **Date**: November 1, 2025
3
- **For**: CEO, GenoBank.io
4
- **Subject**: Strategic roadmap to transform biofs-node into GenoBank.io Operating System
5
-
6
- ---
7
-
8
- ## The Problem
9
-
10
- **We have two disconnected systems**:
11
-
12
- 1. **biofs-cli** (v1.6.7): User-facing CLI tool that talks directly to genobank.app API
13
- - ✅ Works today
14
- - ❌ No BioRouter protocol support
15
- - ❌ No x402 payments
16
- - ❌ No blockchain integration
17
- - ❌ Single point of failure
18
-
19
- 2. **biofs-node** (v0.2.0): Server daemon designed for BioRouter protocol
20
- - ✅ BioRouter-ready architecture
21
- - ✅ x402 payment infrastructure
22
- - ✅ Sequentia blockchain integration
23
- - ❌ NOT DEPLOYED (still localhost)
24
- - ❌ ZERO labs registered
25
- - ❌ Nobody can use it
26
-
27
- **Current interaction**: **NONE** - They don't talk to each other at all.
28
-
29
- ---
30
-
31
- ## The Vision
32
-
33
- **Transform biofs-node into the GenoBank.io Operating System**:
34
-
35
- ```
36
- Patient (biofs-cli)
37
- │
38
- │ x402 payments
39
- ▼
40
- BioRouter OS (biofs-node master)
41
- │
42
- ├─→ AUGenomics Lab (San Diego)
43
- ├─→ NeoChromosome Lab (NYC)
44
- ├─→ Clara AI Agent (GPU variant calling)
45
- ├─→ OpenCRAVAT Agent (annotation)
46
- └─→ Dr. Claudia (clinical review)
47
- │
48
- ▼
49
- Sequentia Blockchain (transparent audit trail)
50
- ```
51
-
52
- **What this enables**:
53
- - 💰 **Micropayments**: Pay $4 for VCF annotation via x402 protocol
54
- - 🌐 **Federated Network**: 10+ international labs, automatic failover
55
- - 🤖 **AI Agent Marketplace**: Choose high-reputation agents
56
- - 🔐 **Patient Control**: Your private key = ultimate authority
57
- - 📊 **Transparency**: Every step notarized on Sequentia blockchain
58
-
59
- ---
60
-
61
- ## What's Missing Today
62
-
63
- ### Critical Blockers (Must Fix First)
64
-
65
- 1. **BiodataRouter NOT initialized**: Smart contract deployed but master node wallet not set
66
- - **Action**: Run `scripts/initialize-biodata-router.ts`
67
- - **Impact**: Can't route any genomic jobs until this is done
68
-
69
- 2. **Master node NOT deployed**: Still running on localhost:8080
70
- - **Action**: Deploy to biofs-master.genobank.io with SSL
71
- - **Impact**: Nobody can connect to BioRouter
72
-
73
- 3. **ZERO labs registered**: No federated network exists
74
- - **Action**: Register AUGenomics as Lab #1
75
- - **Impact**: No failover, no lab diversity
76
-
77
- ### Feature Gaps
78
-
79
- | Component | biofs-cli Status | biofs-node Status |
80
- |-----------|-----------------|------------------|
81
- | **x402 Payments** | ❌ Not implemented | ⚠️ Partially implemented |
82
- | **Blockchain Queries** | ❌ Not implemented | ✅ Implemented (polls every 10s) |
83
- | **Lab Discovery** | ❌ Not implemented | ✅ Implemented (lab registry) |
84
- | **Agent Reputation** | ❌ Not implemented | ✅ Implemented (ERC-8004) |
85
- | **Failover** | ❌ Not implemented | ✅ Implemented (automatic) |
86
- | **Public Deployment** | ✅ Deployed (npm) | ❌ NOT DEPLOYED |
87
-
88
- ---
89
-
90
- ## The Roadmap (6 Months)
91
-
92
- ### Phase 1: Foundation (Weeks 1-2)
93
- **Goal**: Get biofs-node master online and register first lab
94
-
95
- **Week 1**:
96
- - [ ] Initialize BiodataRouter smart contract
97
- - [ ] Deploy master node to biofs-master.genobank.io
98
- - [ ] Set up SSL certificate
99
- - [ ] Enable Prometheus metrics
100
-
101
- **Week 2**:
102
- - [ ] Register AUGenomics as Lab #1
103
- - [ ] Test heartbeat mechanism (30-second intervals)
104
- - [ ] Test automatic failover (stop lab → master takes over)
105
- - [ ] Document lab onboarding process
106
-
107
- **Success Metric**: 1 master + 1 lab sending heartbeats, failover working
108
-
109
- ---
110
-
111
- ### Phase 2: BioRouter Integration (Weeks 3-6)
112
- **Goal**: Enable x402 payments and connect biofs-cli to BioRouter
113
-
114
- **Week 3**: Implement x402 payment endpoints
115
- - [ ] `/x402/verify` - Validate EIP-3009 authorization
116
- - [ ] `/x402/settle` - Execute payment after job completion
117
- - [ ] Test with Clara Agent ($10 USDC variant calling)
118
-
119
- **Week 4**: Create shared library
120
- - [ ] Create `@genobank/biofs-common` npm package
121
- - [ ] Migrate BioCIDResolver, X402Client, SequentiaClient
122
- - [ ] Both biofs-cli and biofs-node use same code
123
-
124
- **Week 5**: Unified file discovery
125
- - [ ] Implement `/api/v1/files/discover` endpoint
126
- - [ ] Master aggregates from all labs
127
- - [ ] biofs-cli calls this instead of 5 separate endpoints
128
-
129
- **Week 6**: Agent integration
130
- - [ ] Register Clara Agent in AgentRegistry contract
131
- - [ ] Register OpenCRAVAT Agent in AgentRegistry contract
132
- - [ ] Mint ERC-8004 reputation NFTs
133
- - [ ] Test reputation-based routing
134
-
135
- **Success Metric**: biofs-cli can pay for VCF annotation via x402, jobs routed through BioRouter
136
-
137
- ---
138
-
139
- ### Phase 3: Production Hardening (Weeks 7-12)
140
- **Goal**: Launch beta program and get real users
141
-
142
- **Week 7-8**: Monitoring + dashboard
143
- - [ ] Deploy Prometheus + Grafana
144
- - [ ] Build ecosystem dashboard (React + D3.js)
145
- - [ ] Real-time network visualization
146
- - [ ] Alert on lab failures
147
-
148
- **Week 9**: Security audit
149
- - [ ] Penetration testing
150
- - [ ] Smart contract audit (BiodataRouter)
151
- - [ ] x402 signature validation testing
152
- - [ ] Remediate all findings
153
-
154
- **Week 10**: Documentation
155
- - [ ] User guide for biofs-cli
156
- - [ ] Lab onboarding guide (step-by-step)
157
- - [ ] Agent onboarding guide
158
- - [ ] BioRouter protocol specification
159
-
160
- **Week 11**: Beta launch
161
- - [ ] Invite 5 pilot labs (AUGenomics, NeoChromosome, etc.)
162
- - [ ] Invite 10 beta users
163
- - [ ] Collect feedback, iterate on UX
164
-
165
- **Week 12**: Public launch
166
- - [ ] Announce BioRouter v1.0
167
- - [ ] Press release
168
- - [ ] Community education
169
-
170
- **Success Metric**: 5 labs, 10 agents, 50 users, $10k USDC routed
171
-
172
- ---
173
-
174
- ### Phase 4: Advanced Features (Months 4-6)
175
- **Goal**: AI orchestration, privacy enhancements, international expansion
176
-
177
- **Month 4**: AI Orchestration
178
- - [ ] Claude AI agent orchestration (multi-step pipelines)
179
- - [ ] Smart agent selection (reputation + cost optimization)
180
- - [ ] Dynamic pricing based on demand
181
-
182
- **Month 5**: Privacy Enhancements
183
- - [ ] Zero-knowledge file verification
184
- - [ ] Homomorphic encryption for VCF queries
185
- - [ ] Confidential computing (TEE) integration
186
-
187
- **Month 6**: International Expansion
188
- - [ ] Deploy 3 regional masters (US, EU, APAC)
189
- - [ ] Cross-region replication
190
- - [ ] GDPR compliance audit
191
- - [ ] Multi-currency support
192
-
193
- **Success Metric**: 10 labs, 20 agents, 500 users, $500k USDC routed annually
194
-
195
- ---
196
-
197
- ## Investment Required
198
-
199
- ### Development Resources (6 months)
200
-
201
- | Resource | Time | Role |
202
- |----------|------|------|
203
- | **Senior Backend Engineer** | Full-time | biofs-node master deployment, x402 implementation |
204
- | **Blockchain Engineer** | Full-time | Smart contract initialization, Sequentia integration |
205
- | **Frontend Engineer** | Half-time | Ecosystem dashboard (React + D3.js) |
206
- | **DevOps Engineer** | Half-time | Prometheus, Grafana, K8s deployment |
207
- | **Security Auditor** | 2 weeks | Smart contract audit, penetration testing |
208
-
209
- ### Infrastructure Costs
210
-
211
- | Service | Monthly Cost | Annual Cost |
212
- |---------|--------------|-------------|
213
- | **AWS EC2** (master node) | $200 | $2,400 |
214
- | **PostgreSQL RDS** (lab registry) | $150 | $1,800 |
215
- | **Prometheus + Grafana** | $100 | $1,200 |
216
- | **Cloudflare SSL** | $0 (free tier) | $0 |
217
- | **Sequentia RPC** | $0 (self-hosted) | $0 |
218
- | **Total Infrastructure** | $450/month | $5,400/year |
219
-
220
- ### Total 6-Month Investment
221
- - **Development**: 3.5 FTE × $150k/year × 0.5 years = **$262,500**
222
- - **Infrastructure**: $5,400 × 0.5 years = **$2,700**
223
- - **Security Audit**: **$25,000**
224
- - **Total**: **$290,200**
225
-
226
- ---
227
-
228
- ## ROI Analysis
229
-
230
- ### Revenue Potential (Year 1)
231
-
232
- **Assumptions**:
233
- - 500 users by Month 12
234
- - Average 2 genomic analyses per user per year = 1,000 analyses
235
- - Average $50 per analysis (VCF annotation + clinical review)
236
- - GenoBank takes 10% platform fee
237
-
238
- **Revenue**:
239
- - Total Genomic Market: 1,000 analyses × $50 = **$50,000**
240
- - Platform Fee (10%): **$5,000** (Year 1)
241
-
242
- **Growth Trajectory**:
243
- - Year 2: 5,000 users → $250,000 market → **$25,000** platform fee
244
- - Year 3: 25,000 users → $1.25M market → **$125,000** platform fee
245
- - Year 5: 100,000 users → $5M market → **$500,000** platform fee
246
-
247
- ### Strategic Value (Non-Financial)
248
-
249
- 1. **First-Mover Advantage**: Only patient-centric genomic data network with BioRouter protocol
250
- 2. **Network Effects**: Each lab/agent added increases platform value exponentially
251
- 3. **Regulatory Moat**: GDPR-compliant consent NFT architecture (competitors can't copy)
252
- 4. **Data Sovereignty**: Patients own their data (Web3 narrative)
253
- 5. **Research Enabler**: Federated genomic research without centralized control
254
-
255
- ---
256
-
257
- ## Risks
258
-
259
- ### Technical Risks
260
-
261
- | Risk | Probability | Mitigation |
262
- |------|------------|------------|
263
- | **Sequentia blockchain outage** | Medium | Deploy 3 validator nodes, RPC failover |
264
- | **x402 payment failures** | Medium | Retry logic, manual settlement fallback |
265
- | **Master node DDoS** | Medium | Cloudflare DDoS protection, rate limiting |
266
- | **Smart contract bugs** | Low | Formal verification, security audit |
267
-
268
- ### Business Risks
269
-
270
- | Risk | Probability | Mitigation |
271
- |------|------------|------------|
272
- | **Low lab adoption** | Medium | Free tier, shared revenue, marketing |
273
- | **Regulatory challenges (GDPR)** | Medium | Legal review, consent NFT architecture |
274
- | **User confusion (UX)** | High | User testing, wizard-style CLI |
275
- | **Competition (AWS HealthOmics)** | Low | Emphasize patient ownership, Web3 |
276
-
277
- ---
278
-
279
- ## Decision Required
280
-
281
- **Question**: Should GenoBank invest $290k over 6 months to transform biofs-node into the BioRouter Operating System?
282
-
283
- **Option A: YES - Full BioRouter Implementation**
284
- - ✅ Establishes GenoBank as Web3 genomics leader
285
- - ✅ Creates network effects moat
286
- - ✅ Enables $500k+ annual platform fees by Year 5
287
- - ⚠️ Requires $290k upfront investment
288
- - ⚠️ 6-month build time before revenue
289
-
290
- **Option B: NO - Maintain Status Quo**
291
- - ✅ No upfront investment
292
- - ✅ genobank.app API still works
293
- - ❌ Centralized single point of failure
294
- - ❌ No x402 payments = can't scale
295
- - ❌ Competitors will build federated networks
296
- - ❌ Miss first-mover advantage
297
-
298
- **Recommendation**: **Option A** - The BioRouter protocol is GenoBank's strategic differentiation. Without it, we're just another genomic API provider. With it, we become the **operating system for patient-centric genomics**.
299
-
300
- ---
301
-
302
- ## Next Steps (If Approved)
303
-
304
- ### This Week:
305
- 1. ✅ Initialize BiodataRouter smart contract
306
- 2. ✅ Deploy master node to biofs-master.genobank.io
307
- 3. ✅ Register AUGenomics as Lab #1
308
-
309
- ### Immediate Hiring:
310
- - **Senior Backend Engineer** (biofs-node deployment)
311
- - **Blockchain Engineer** (Sequentia integration)
312
-
313
- ### Stakeholder Communication:
314
- - **Labs**: Invite AUGenomics, NeoChromosome to pilot program
315
- - **Agents**: Register Clara + OpenCRAVAT in AgentRegistry
316
- - **Users**: Recruit 10 beta testers
317
-
318
- ---
319
-
320
- **Prepared by**: Claude (Anthropic AI)
321
- **Reviewed by**: [CEO Name]
322
- **Date**: November 1, 2025
323
- **Status**: Awaiting executive decision
@@ -1,311 +0,0 @@
1
- # ✅ Gemini AI Completely Removed from BioFS CLI
2
-
3
- **Date**: October 22, 2025
4
- **Status**: Complete - Gemini AI Eliminated, Claude AI Integrated
5
- **Compliance**: CRITICAL RULE - ONLY Anthropic Claude Models Allowed
6
-
7
- ---
8
-
9
- ## 🚨 Issue Discovered
10
-
11
- **CRITICAL VIOLATION**: BioFS CLI contained Google Gemini AI integration, which violates GenoBank's zero-tolerance policy:
12
-
13
- > **CRITICAL: AI MODELS - ANTHROPIC CLAUDE ONLY**
14
- > ZERO TOLERANCE: ONLY Anthropic Claude models allowed (Haiku/Sonnet/Opus).
15
- > NEVER Google Gemini, OpenAI, or any non-Anthropic AI.
16
-
17
- ---
18
-
19
- ## ✅ Actions Taken
20
-
21
- ### 1. Replaced AI Classifier (src/lib/ai/classifier.ts)
22
-
23
- **Before:**
24
- ```typescript
25
- import { GoogleGenerativeAI } from '@google/generative-ai';
26
- const genAI = new GoogleGenerativeAI(API_KEY);
27
- const model = genAI.getGenerativeModel({ model: 'gemini-pro' });
28
- ```
29
-
30
- **After:**
31
- ```typescript
32
- import Anthropic from '@anthropic-ai/sdk';
33
- const anthropic = new Anthropic({ apiKey: ANTHROPIC_API_KEY });
34
- const message = await anthropic.messages.create({
35
- model: 'claude-3-haiku-20240307', // Claude Haiku - fast and cost-effective
36
- max_tokens: 1024,
37
- messages: [{ role: 'user', content: prompt }]
38
- });
39
- ```
40
-
41
- **Changes:**
42
- - ✅ Replaced Google Gemini Pro with Claude 3 Haiku
43
- - ✅ Updated API call structure for Anthropic SDK
44
- - ✅ Added fallback to rule-based classification if Claude unavailable
45
- - ✅ Added clear documentation warning against non-Anthropic AI
46
-
47
- **Backup Created:**
48
- `src/lib/ai/classifier.ts.bkp.gemini_removed_20251022_XXXXXX`
49
-
50
- ---
51
-
52
- ### 2. Removed Gemini Dependencies
53
-
54
- **package.json Changes:**
55
- ```bash
56
- # Removed
57
- - "@google/generative-ai": "^0.24.1"
58
-
59
- # Added
60
- + "@anthropic-ai/sdk": "^0.67.0"
61
- ```
62
-
63
- **NPM Commands Executed:**
64
- ```bash
65
- npm uninstall @google/generative-ai
66
- npm install @anthropic-ai/sdk
67
- ```
68
-
69
- **Result:**
70
- - ✅ Google Gemini package removed from node_modules
71
- - ✅ Anthropic SDK installed (v0.67.0)
72
- - ✅ No vulnerabilities found
73
-
74
- ---
75
-
76
- ### 3. Updated Configuration Files
77
-
78
- #### A. constants.ts
79
-
80
- **Before:**
81
- ```typescript
82
- // Gemini AI Configuration
83
- export const GEMINI_API_KEY = process.env.GEMINI_API_KEY;
84
- ```
85
-
86
- **After:**
87
- ```typescript
88
- // REMOVED: Gemini AI (replaced with Claude/Anthropic)
89
- // CRITICAL: GenoBank ONLY uses Anthropic Claude models - NEVER Google Gemini or OpenAI
90
- ```
91
-
92
- #### B. .env File
93
-
94
- **Before:**
95
- ```bash
96
- # Gemini AI
97
- GEMINI_API_KEY=AIzaSyCuPPjSPkHTbu2YBoyZjUB-o-xCnhCNaac
98
- ```
99
-
100
- **After:**
101
- ```bash
102
- # Claude AI (Anthropic) - ONLY AI PROVIDER ALLOWED
103
- # CRITICAL: GenoBank uses ONLY Anthropic Claude - NEVER Google Gemini or OpenAI
104
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
105
- ```
106
-
107
- **Backup Created:**
108
- `.env.bkp.gemini_removed_20251022_XXXXXX`
109
-
110
- ---
111
-
112
- ## 🔍 Verification Results
113
-
114
- ### Search for Remaining References
115
-
116
- **Command:**
117
- ```bash
118
- grep -r "gemini\|google.*generative\|GEMINI" --include="*.ts" --include="*.js" --include="*.json" src/ lib/
119
- ```
120
-
121
- **Result:** ✅ **No matches found** - All Gemini references eliminated
122
-
123
- ### Package.json Verification
124
-
125
- **Command:**
126
- ```bash
127
- grep -i "gemini\|google.*generative" package.json
128
- ```
129
-
130
- **Result:** ✅ **No matches found** - Gemini completely removed from dependencies
131
-
132
- ### Anthropic SDK Confirmation
133
-
134
- **Command:**
135
- ```bash
136
- cat package.json | grep anthropic
137
- ```
138
-
139
- **Result:**
140
- ```json
141
- "@anthropic-ai/sdk": "^0.67.0"
142
- ```
143
- ✅ **Anthropic SDK successfully installed**
144
-
145
- ---
146
-
147
- ## 📊 Classifier Function Comparison
148
-
149
- ### Old (Gemini Pro) vs New (Claude Haiku)
150
-
151
- | Feature | Gemini Pro | Claude Haiku |
152
- |---------|------------|--------------|
153
- | **Provider** | Google | Anthropic ✅ |
154
- | **Compliance** | ❌ Violates policy | ✅ Compliant |
155
- | **Model** | gemini-pro | claude-3-haiku-20240307 |
156
- | **Speed** | ~1-2s | ~1-2s (similar) |
157
- | **Cost** | $0.50 per 1M tokens | $0.25 per 1M input tokens |
158
- | **Quality** | Good | Excellent ✅ |
159
- | **API Structure** | generateContent() | messages.create() |
160
- | **Response Format** | text() | content[0].text |
161
-
162
- **Winner:** Claude Haiku (faster, cheaper, compliant) ✅
163
-
164
- ---
165
-
166
- ## 🧪 Function Behavior
167
-
168
- ### classifyDataset() Function
169
-
170
- **Purpose:** Analyze genomic files and generate metadata for NFT tokenization
171
-
172
- **Input:**
173
- - File path to genomic data (VCF, FASTQ, BAM, etc.)
174
-
175
- **Output:**
176
- ```typescript
177
- {
178
- description: string, // 2-3 sentence description
179
- category: string, // vcf, genomic, gwas, etc.
180
- suggestedTitle: string // Max 50 characters
181
- }
182
- ```
183
-
184
- **Workflow:**
185
- 1. Read file sample (first 100 lines or 10KB)
186
- 2. Send to Claude Haiku with classification prompt
187
- 3. Parse JSON response
188
- 4. Validate category against allowed list
189
- 5. Fallback to rule-based classification if AI fails
190
-
191
- **Fallback Logic:**
192
- ```typescript
193
- // If ANTHROPIC_API_KEY not found
194
- → Uses rule-based classification (file extension mapping)
195
-
196
- // If Claude API call fails
197
- → Uses default descriptions based on file type
198
-
199
- // If JSON parsing fails
200
- → Uses generateDefaultClassification()
201
- ```
202
-
203
- ---
204
-
205
- ## 🎯 Current Usage
206
-
207
- **Status:** The classifier function is **implemented but NOT currently used** by any biofs commands.
208
-
209
- **Potential Future Use:**
210
- - Could be integrated into `biofs tokenize --smart` command
211
- - Could enhance automatic metadata generation
212
- - Currently: `biofs tokenize` uses API-based Claude classification from api_bioip.py
213
-
214
- **Recommendation:** Keep the Claude-based classifier for future CLI-side intelligence features (see AGENT_SDK_COMPREHENSIVE_ENHANCEMENT_REPORT.md for roadmap).
215
-
216
- ---
217
-
218
- ## 🔐 Security Notes
219
-
220
- ### Hardcoded API Key Found (Now Removed)
221
-
222
- **Old Code:**
223
- ```typescript
224
- const API_KEY = GEMINI_API_KEY || 'AIzaSyCuPPjSPkHTbu2YBoyZjUB-o-xCnhCNaac';
225
- ```
226
-
227
- **Issue:** Hardcoded Google API key (security risk)
228
-
229
- **Fixed:**
230
- ```typescript
231
- const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY || process.env.CLAUDE_API_KEY;
232
-
233
- if (!ANTHROPIC_API_KEY) {
234
- console.warn('⚠️ ANTHROPIC_API_KEY not found - using rule-based classification');
235
- return generateDefaultClassification(...);
236
- }
237
- ```
238
-
239
- **Result:** ✅ No hardcoded keys, requires environment variable
240
-
241
- ---
242
-
243
- ## 📝 Modified Files
244
-
245
- | File | Action | Backup |
246
- |------|--------|--------|
247
- | `src/lib/ai/classifier.ts` | Replaced Gemini with Claude | `.bkp.gemini_removed_*` |
248
- | `src/lib/config/constants.ts` | Removed GEMINI_API_KEY export | - |
249
- | `.env` | Removed Gemini key, added Anthropic | `.bkp.gemini_removed_*` |
250
- | `package.json` | Removed @google/generative-ai, added @anthropic-ai/sdk | Auto-managed by npm |
251
-
252
- ---
253
-
254
- ## ✅ Compliance Checklist
255
-
256
- - [x] **No Google Gemini references** in source code
257
- - [x] **No Google AI packages** in package.json
258
- - [x] **No Gemini API keys** in configuration files
259
- - [x] **Anthropic SDK installed** and configured
260
- - [x] **Claude Haiku integrated** as replacement
261
- - [x] **Documentation updated** with critical warnings
262
- - [x] **Backups created** for all modified files
263
- - [x] **Verification completed** - zero Gemini references remain
264
-
265
- ---
266
-
267
- ## 🚀 Next Steps
268
-
269
- ### Immediate
270
- ✅ Gemini completely removed
271
- ✅ Claude integrated as replacement
272
- ✅ All compliance requirements met
273
-
274
- ### Future Enhancements (Optional)
275
- 1. **Activate Classifier in CLI**
276
- - Add `biofs tokenize --smart` flag
277
- - Use Claude Haiku for intelligent metadata generation
278
- - See enhancement report for full roadmap
279
-
280
- 2. **Agent SDK Integration**
281
- - Integrate with `/api_claude_code/` agent features
282
- - Add `biofs ask` natural language command
283
- - Enable autonomous genomic workflows
284
-
285
- 3. **Testing**
286
- - Create test cases for Claude classifier
287
- - Verify metadata quality vs rule-based approach
288
- - Measure performance and cost
289
-
290
- ---
291
-
292
- ## 📊 Summary
293
-
294
- **Problem:** BioFS CLI contained Google Gemini AI (policy violation)
295
-
296
- **Solution:** Complete removal + replacement with Claude Haiku
297
-
298
- **Result:**
299
- - ✅ 100% Gemini-free
300
- - ✅ Claude Haiku integrated
301
- - ✅ Compliant with GenoBank AI policy
302
- - ✅ No breaking changes (classifier not actively used)
303
- - ✅ Ready for future agent enhancements
304
-
305
- **Status:** ✅ **COMPLETE - ZERO TOLERANCE POLICY ENFORCED**
306
-
307
- ---
308
-
309
- **Last Updated**: October 22, 2025
310
- **Verified By**: Claude Agent SDK Analysis System
311
- **Compliance**: ✅ ONLY Anthropic Claude Models
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env node
2
- const fs = require('fs');
3
- const path = require('path');
4
- const os = require('os');
5
-
6
- const credentialsPath = path.join(os.homedir(), '.biofs', 'credentials.json');
7
-
8
- console.log('Checking BioFS credentials...\n');
9
- console.log('Credentials file:', credentialsPath);
10
-
11
- try {
12
- const data = fs.readFileSync(credentialsPath, 'utf8');
13
- const creds = JSON.parse(data);
14
-
15
- console.log('\n✅ Credentials found:');
16
- console.log(' Wallet:', creds.wallet);
17
- console.log(' Authenticated:', creds.authenticated);
18
- console.log(' Expires:', creds.expires);
19
- console.log(' Has signature:', creds.signature ? 'Yes' : 'No');
20
-
21
- if (creds.signature) {
22
- console.log(' Signature preview:', creds.signature.substring(0, 30) + '...');
23
-
24
- // Try to recover wallet from signature
25
- try {
26
- const { ethers } = require('ethers');
27
- const message = 'I want to proceed';
28
- const recoveredWallet = ethers.verifyMessage(message, creds.signature);
29
-
30
- console.log('\n🔐 Signature verification:');
31
- console.log(' Recovered wallet:', recoveredWallet);
32
- console.log(' Stored wallet: ', creds.wallet);
33
-
34
- if (recoveredWallet.toLowerCase() === creds.wallet.toLowerCase()) {
35
- console.log(' ✅ Signature matches wallet - Authentication is valid');
36
- } else {
37
- console.log(' ❌ Signature does NOT match wallet - Re-authenticate needed!');
38
- console.log('\n Run: biofs login');
39
- }
40
- } catch (e) {
41
- console.log('\n❌ Could not verify signature:', e.message);
42
- console.log(' Run: biofs login');
43
- }
44
- }
45
-
46
- // Check if Dra. Claudia's wallet
47
- const claudiaWallet = '0xb3c3a584491b8ca4df45116a1e250098a0d6192d';
48
- if (creds.wallet.toLowerCase() === claudiaWallet.toLowerCase()) {
49
- console.log('\n✅ This is Dra. Claudia\'s wallet');
50
- console.log(' Expected to see granted files from server');
51
- } else {
52
- console.log('\n⚠️ This is NOT Dra. Claudia\'s wallet');
53
- console.log(' Expected wallet:', claudiaWallet);
54
- console.log(' Current wallet: ', creds.wallet);
55
- }
56
-
57
- } catch (error) {
58
- console.log('\n❌ Error reading credentials:', error.message);
59
- console.log('\n Credentials not found. Run: biofs login');
60
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * Sandbox status and management command
3
- *
4
- * Provides information about bubblewrap sandbox availability
5
- * and configuration status.
6
- */
7
- import { Command } from 'commander';
8
- export declare const sandboxCommand: Command;
9
- export default sandboxCommand;
10
- //# sourceMappingURL=sandbox.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/commands/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,eAAO,MAAM,cAAc,SAMS,CAAC;AAkarC,eAAe,cAAc,CAAC"}