Files
Profa b56dad4f4c feat: complete OpenCode integration — all 40 tasks across 5 workstreams
Implements the full AQE-OpenCode integration plan:

WS0 Foundation: shared types (aqe-opencode-types), monorepo packages
WS1 MCP Server: transport factory (SSE/WS/HTTP routing), output compaction
  middleware, health endpoint, opencode.json template with SSE config
WS2 Plugin: 4 lifecycle hooks, config schema (Zod), session lifecycle,
  graceful degradation middleware, context budget manager, LSP bridge
WS3 Agent/Skill: 10 agent configs, 15 QE skills, 5 QCSD swarm skills,
  5 tool wrappers, permissions.yaml, generator scripts
WS4 Provider: capability matrix, skill tier registry (75 skills classified),
  degradation middleware, output format adapters
WS5 Testing: integration, unit, validation, E2E smoke tests (31 passing),
  integration guide, tool compatibility docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 18:54:19 +00:00

82 lines
2.8 KiB
TypeScript

import { z } from 'zod';
export default {
name: 'qe-full-audit',
description: 'Run comprehensive QE audit: quality assessment + security scan + coverage analysis in sequence',
parameters: z.object({
target: z.string().describe('Target path to audit (e.g., "src/" or "src/services/")'),
includeTests: z.boolean().default(true).describe('Include test files in the audit scope'),
runGate: z.boolean().default(true).describe('Run quality gate evaluation to determine pass/fail'),
dast: z.boolean().default(false).describe('Include DAST (dynamic) scanning in addition to SAST'),
}),
execute: async (
params: { target: string; includeTests: boolean; runGate: boolean; dast: boolean },
ctx: any,
) => {
const startTime = Date.now();
const results: Record<string, any> = {};
const errors: string[] = [];
// Step 1: Quality assessment
try {
results.quality = await ctx.callTool('mcp:agentic-qe:quality_assess', {
runGate: params.runGate,
});
} catch (err: any) {
errors.push(`Quality assessment failed: ${err.message}`);
}
// Step 2: Security scan (SAST + optional DAST)
try {
results.security = await ctx.callTool('mcp:agentic-qe:security_scan_comprehensive', {
target: params.target,
sast: true,
dast: params.dast,
});
} catch (err: any) {
errors.push(`Security scan failed: ${err.message}`);
}
// Step 3: Coverage analysis with gap detection
try {
results.coverage = await ctx.callTool('mcp:agentic-qe:coverage_analyze_sublinear', {
target: params.target,
detectGaps: true,
});
} catch (err: any) {
errors.push(`Coverage analysis failed: ${err.message}`);
}
const elapsed = Date.now() - startTime;
// Store audit results in memory for tracking
try {
await ctx.callTool('mcp:agentic-qe:memory_store', {
key: `audit/${params.target}/${Date.now()}`,
namespace: 'qe-audits',
value: {
target: params.target,
timestamp: new Date().toISOString(),
quality: results.quality ?? null,
security: results.security ?? null,
coverage: results.coverage ?? null,
errors,
elapsedMs: elapsed,
},
});
} catch {
// Non-critical: memory store failure should not fail the audit
}
return {
target: params.target,
quality: results.quality ?? { error: 'Assessment failed' },
security: results.security ?? { error: 'Scan failed' },
coverage: results.coverage ?? { error: 'Analysis failed' },
errors: errors.length > 0 ? errors : undefined,
elapsedMs: elapsed,
summary: `Audit completed in ${elapsed}ms. ${errors.length} errors encountered.`,
};
},
};