From 88244a4276bfcf4152cde893eb55a39ec5b3cf18 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 23 Nov 2025 00:28:39 +0000 Subject: [PATCH] Fix QualityAssuranceAgent type errors and deploy Agent 9 - Fix PlantBlock import to use correct module path (PlantBlock.ts) - Update crypto import to use namespace import pattern - Fix blockchain.getChain() to use blockchain.chain property - Add 'critical' severity to QualityReport type for consistency --- lib/agents/QualityAssuranceAgent.ts | 10 +++++----- lib/agents/types.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/agents/QualityAssuranceAgent.ts b/lib/agents/QualityAssuranceAgent.ts index 742bdae..e2eb0b0 100644 --- a/lib/agents/QualityAssuranceAgent.ts +++ b/lib/agents/QualityAssuranceAgent.ts @@ -14,8 +14,8 @@ import { BaseAgent } from './BaseAgent'; import { AgentConfig, AgentTask, QualityReport } from './types'; import { getBlockchain } from '../blockchain/manager'; import { getTransportChain } from '../transport/tracker'; -import { PlantBlock } from '../blockchain/types'; -import crypto from 'crypto'; +import { PlantBlock } from '../blockchain/PlantBlock'; +import * as crypto from 'crypto'; interface IntegrityCheck { chainId: string; @@ -131,7 +131,7 @@ export class QualityAssuranceAgent extends BaseAgent { */ private async verifyPlantChain(): Promise { const blockchain = getBlockchain(); - const chain = blockchain.getChain(); + const chain = blockchain.chain; let hashMismatches = 0; let linkBroken = 0; @@ -205,7 +205,7 @@ export class QualityAssuranceAgent extends BaseAgent { const issues: DataQualityIssue[] = []; const blockchain = getBlockchain(); - const chain = blockchain.getChain().slice(1); + const chain = blockchain.chain.slice(1); const seenIds = new Set(); @@ -390,7 +390,7 @@ export class QualityAssuranceAgent extends BaseAgent { */ private calculateStatistics(): DataStatistics { const blockchain = getBlockchain(); - const chain = blockchain.getChain().slice(1); + const chain = blockchain.chain.slice(1); let completeRecords = 0; let partialRecords = 0; diff --git a/lib/agents/types.ts b/lib/agents/types.ts index a546387..5913ed2 100644 --- a/lib/agents/types.ts +++ b/lib/agents/types.ts @@ -160,7 +160,7 @@ export interface QualityReport { blockIndex: number; issueType: string; description: string; - severity: 'low' | 'medium' | 'high'; + severity: 'low' | 'medium' | 'high' | 'critical'; }[]; lastVerifiedAt: string; }