Files
Profa 2253d05618 feat: flatten project structure — archive v2, promote v3 to root
Remove the nested v3/ subdirectory by moving all active source code,
tests, configs, and assets directly to the project root. Archive v2/
(dead code, 847MB) to v2-archive.tar.gz.

Key changes:
- Move v3/src/ → src/, v3/tests/ → tests/, v3/packages/ → packages/
- Move v3/tsconfig.json, v3/vitest.config.ts to root
- Merge v3/package.json into root package.json (ESM, scripts, deps, exports)
- Merge v3/scripts/ into scripts/, v3/implementation/ into docs/implementation/
- Update all CI workflows to remove "cd v3 &&" and v3/ path prefixes
- Fix all init installer path resolution (3-level-up → 2-level-up)
- Fix hooks to use "node ./dist/cli/bundle.js" instead of bare "aqe"
- Update settings.json ADR/DDD directories to docs/implementation/
- Fix helper scripts (statusline, adr-compliance, ddd-tracker, guidance-hooks)
- Update 58 agent definitions: aqe/v3/ → aqe/ memory namespaces
- Update 15 guidance shards: v3/src/ → src/ path references
- Fix sync interfaces: remove v3/ and v2/ path references
- Fix test path calculations (process.cwd() + '..' no longer needed)
- Fix flaky perf test threshold (500ms → 1000ms for CI environments)
- Fix complexity-analyzer test to match ADR-051 keyword-based eligibility

Build passes, 17,901 tests pass, CLI and MCP bundles verified.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:35:41 +00:00

80 lines
2.5 KiB
TypeScript

/**
* AQE OpenCode Plugin Configuration
*
* Zod schema for plugin configuration with sensible defaults.
* All options can be overridden per-project in opencode.json.
*
* @module config
*/
import { z } from 'zod';
export const AQEPluginConfigSchema = z.object({
/** Master enable/disable switch */
enabled: z.boolean().default(true),
/** Per-hook enable/disable toggles */
hooks: z.object({
onToolCallBefore: z.boolean().default(true),
onToolCallAfter: z.boolean().default(true),
onSessionPromptBefore: z.boolean().default(true),
onSessionPromptAfter: z.boolean().default(true),
}).default({}),
/** Memory/persistence configuration */
memory: z.object({
/** Path to SQLite memory database */
dbPath: z.string().default('.agentic-qe/memory.db'),
/** Enable HNSW vector search for pattern matching */
hnswEnabled: z.boolean().default(true),
}).default({}),
/** Guidance injection configuration */
guidance: z.object({
/** Max tokens for injected guidance (prevents prompt bloat) */
maxTokens: z.number().min(0).max(10000).default(2000),
/** Enable model routing hints based on complexity */
enableRouting: z.boolean().default(true),
/** Minimum confidence for pattern injection */
minPatternConfidence: z.number().min(0).max(1).default(0.6),
}).default({}),
/** Active QE domains for pattern matching */
domains: z.array(z.string()).default([
'test-generation',
'quality-assessment',
'security',
'coverage',
]),
/** Safety configuration */
safety: z.object({
/** Block writes to .db files */
blockDbWrites: z.boolean().default(true),
/** Block dangerous bash commands */
blockDangerousCommands: z.boolean().default(true),
/** Dangerous command patterns (regex strings) */
dangerousPatterns: z.array(z.string()).default([
'rm\\s+-rf\\s+/',
'rm\\s+-rf\\s+\\.',
'drop\\s+table',
'delete\\s+from',
'truncate\\s+',
'mkfs\\.',
':\\(\\)\\{\\s*:\\|:\\s*&\\s*\\}\\s*;\\s*:',
'dd\\s+if=.*of=/dev/',
'chmod\\s+-R\\s+777\\s+/',
]),
}).default({}),
/** Pattern promotion settings */
patternPromotion: z.object({
/** Number of successes before promoting a pattern */
threshold: z.number().min(1).default(3),
/** Minimum success rate for promotion */
successRateMin: z.number().min(0).max(1).default(0.7),
}).default({}),
});
export type AQEPluginConfig = z.infer<typeof AQEPluginConfigSchema>;