mirror of
https://github.com/proffesor-for-testing/agentic-qe.git
synced 2026-09-19 08:45:47 +08:00
2253d05618
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>
157 lines
4.6 KiB
TypeScript
157 lines
4.6 KiB
TypeScript
/**
|
|
* Sample Queries for Token Reduction Benchmark
|
|
*
|
|
* These queries simulate real-world questions developers
|
|
* might ask when exploring a codebase.
|
|
*/
|
|
|
|
export interface QuerySample {
|
|
id: string;
|
|
query: string;
|
|
expectedConcepts: string[];
|
|
expectedFiles: string[];
|
|
complexity: 'simple' | 'medium' | 'complex';
|
|
category: 'architecture' | 'implementation' | 'security' | 'debugging' | 'testing';
|
|
}
|
|
|
|
/**
|
|
* Queries designed to test the code intelligence system's
|
|
* ability to find relevant context while minimizing tokens
|
|
*/
|
|
export const QUERY_SAMPLES: QuerySample[] = [
|
|
// Architecture queries
|
|
{
|
|
id: 'q1',
|
|
query: 'How does the authentication flow work?',
|
|
expectedConcepts: ['login', 'session', 'token', 'JWT'],
|
|
expectedFiles: ['auth-service.ts', 'auth-middleware.ts'],
|
|
complexity: 'medium',
|
|
category: 'architecture',
|
|
},
|
|
{
|
|
id: 'q2',
|
|
query: 'What role-based access control does the system support?',
|
|
expectedConcepts: ['Role', 'permission', 'authorize', 'hasRole'],
|
|
expectedFiles: ['auth-service.ts', 'auth-middleware.ts'],
|
|
complexity: 'medium',
|
|
category: 'architecture',
|
|
},
|
|
{
|
|
id: 'q3',
|
|
query: 'How are sessions managed?',
|
|
expectedConcepts: ['Session', 'createSession', 'refreshToken', 'accessToken'],
|
|
expectedFiles: ['auth-service.ts'],
|
|
complexity: 'simple',
|
|
category: 'architecture',
|
|
},
|
|
|
|
// Implementation queries
|
|
{
|
|
id: 'q4',
|
|
query: 'How is password hashing implemented?',
|
|
expectedConcepts: ['hashPassword', 'salt', 'sha512', 'verifyPassword'],
|
|
expectedFiles: ['auth-service.ts'],
|
|
complexity: 'simple',
|
|
category: 'implementation',
|
|
},
|
|
{
|
|
id: 'q5',
|
|
query: 'What happens when a user fails login multiple times?',
|
|
expectedConcepts: ['failedLoginAttempts', 'lockedUntil', 'handleFailedLogin', 'ACCOUNT_LOCKED'],
|
|
expectedFiles: ['auth-service.ts'],
|
|
complexity: 'medium',
|
|
category: 'implementation',
|
|
},
|
|
{
|
|
id: 'q6',
|
|
query: 'How does token rotation work?',
|
|
expectedConcepts: ['rotateTokens', 'refreshToken', 'blacklist', 'refreshSession'],
|
|
expectedFiles: ['auth-service.ts'],
|
|
complexity: 'complex',
|
|
category: 'implementation',
|
|
},
|
|
|
|
// Security queries
|
|
{
|
|
id: 'q7',
|
|
query: 'How is MFA handled?',
|
|
expectedConcepts: ['mfaEnabled', 'mfaCode', 'verifyMfaCode', 'MFA_REQUIRED'],
|
|
expectedFiles: ['auth-service.ts'],
|
|
complexity: 'medium',
|
|
category: 'security',
|
|
},
|
|
{
|
|
id: 'q8',
|
|
query: 'What security measures prevent brute force attacks?',
|
|
expectedConcepts: ['maxFailedAttempts', 'lockoutDuration', 'RateLimiter'],
|
|
expectedFiles: ['auth-service.ts', 'auth-middleware.ts'],
|
|
complexity: 'complex',
|
|
category: 'security',
|
|
},
|
|
{
|
|
id: 'q9',
|
|
query: 'How are tokens validated and blacklisted?',
|
|
expectedConcepts: ['tokenBlacklist', 'isTokenBlacklisted', 'SESSION_REVOKED'],
|
|
expectedFiles: ['auth-service.ts'],
|
|
complexity: 'simple',
|
|
category: 'security',
|
|
},
|
|
|
|
// Debugging queries
|
|
{
|
|
id: 'q10',
|
|
query: 'What audit logging is available?',
|
|
expectedConcepts: ['AuditLogger', 'AuditLogEntry', 'log', 'query'],
|
|
expectedFiles: ['auth-middleware.ts'],
|
|
complexity: 'simple',
|
|
category: 'debugging',
|
|
},
|
|
{
|
|
id: 'q11',
|
|
query: 'How can I trace failed authentication attempts?',
|
|
expectedConcepts: ['getFailures', 'result', 'reason', 'INVALID_CREDENTIALS'],
|
|
expectedFiles: ['auth-middleware.ts', 'auth-service.ts'],
|
|
complexity: 'medium',
|
|
category: 'debugging',
|
|
},
|
|
|
|
// Testing queries
|
|
{
|
|
id: 'q12',
|
|
query: 'What interfaces need to be mocked for testing auth?',
|
|
expectedConcepts: ['User', 'Session', 'AuthResult', 'LoginCredentials'],
|
|
expectedFiles: ['auth-service.ts'],
|
|
complexity: 'simple',
|
|
category: 'testing',
|
|
},
|
|
];
|
|
|
|
/**
|
|
* Get queries filtered by category
|
|
*/
|
|
export function getQueriesByCategory(category: QuerySample['category']): QuerySample[] {
|
|
return QUERY_SAMPLES.filter((q) => q.category === category);
|
|
}
|
|
|
|
/**
|
|
* Get queries filtered by complexity
|
|
*/
|
|
export function getQueriesByComplexity(complexity: QuerySample['complexity']): QuerySample[] {
|
|
return QUERY_SAMPLES.filter((q) => q.complexity === complexity);
|
|
}
|
|
|
|
/**
|
|
* Calculate expected token reduction based on query complexity
|
|
* Simple queries should achieve ~85% reduction
|
|
* Medium queries should achieve ~80% reduction
|
|
* Complex queries should achieve ~75% reduction
|
|
*/
|
|
export function getExpectedReduction(complexity: QuerySample['complexity']): number {
|
|
const reductions: Record<QuerySample['complexity'], number> = {
|
|
simple: 0.85,
|
|
medium: 0.80,
|
|
complex: 0.75,
|
|
};
|
|
return reductions[complexity];
|
|
}
|