mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-05 15:09:42 +02:00
fix: code cleanup — path traversal, test leaks, dead code, consistency
- Add path traversal protection to GET /api/cases/:name and fix-plan - Use safePathSchema for LinkCaseSchema.path - Fix QR auth test timer leak (afterAll → afterEach) and env var try/finally - Remove dead terminal size check after Zod validation in resize route - Remove no-op sampleCount guard in adaptive timing - Replace hardcoded values with constants in notification-manager and subagent-windows - Add Zod validation to POST /api/auth/revoke - Use _apiPut instead of raw fetch in subagent-windows - Add SwipeHandler.cleanup() for consistency with other mobile handlers - Move NiceConfig/ProcessStats from types/plan.ts to types/common.ts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,36 @@ export interface BufferConfig {
|
||||
/**
|
||||
* Resource types that can be registered for cleanup.
|
||||
*/
|
||||
/**
|
||||
* Configuration for process priority using `nice`.
|
||||
* Lower priority reduces CPU contention with other processes.
|
||||
*/
|
||||
export interface NiceConfig {
|
||||
/** Whether nice priority is enabled */
|
||||
enabled: boolean;
|
||||
/** Nice value (-20 to 19, default: 10 = lower priority) */
|
||||
niceValue: number;
|
||||
}
|
||||
|
||||
export const DEFAULT_NICE_CONFIG: NiceConfig = {
|
||||
enabled: false,
|
||||
niceValue: 10,
|
||||
};
|
||||
|
||||
/**
|
||||
* Process resource statistics
|
||||
*/
|
||||
export interface ProcessStats {
|
||||
/** Memory usage in megabytes */
|
||||
memoryMB: number;
|
||||
/** CPU usage percentage */
|
||||
cpuPercent: number;
|
||||
/** Number of child processes */
|
||||
childCount: number;
|
||||
/** Timestamp of stats collection */
|
||||
updatedAt: number;
|
||||
}
|
||||
|
||||
export type CleanupResourceType = 'timer' | 'interval' | 'watcher' | 'listener' | 'stream';
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,36 +11,6 @@ export type TddPhase = 'setup' | 'test' | 'impl' | 'verify' | 'review';
|
||||
/** Development phase in TDD cycle (alias for TddPhase) */
|
||||
export type PlanPhase = TddPhase;
|
||||
|
||||
/**
|
||||
* Configuration for process priority using `nice`.
|
||||
* Lower priority reduces CPU contention with other processes.
|
||||
*/
|
||||
export interface NiceConfig {
|
||||
/** Whether nice priority is enabled */
|
||||
enabled: boolean;
|
||||
/** Nice value (-20 to 19, default: 10 = lower priority) */
|
||||
niceValue: number;
|
||||
}
|
||||
|
||||
export const DEFAULT_NICE_CONFIG: NiceConfig = {
|
||||
enabled: false,
|
||||
niceValue: 10,
|
||||
};
|
||||
|
||||
/**
|
||||
* Process resource statistics
|
||||
*/
|
||||
export interface ProcessStats {
|
||||
/** Memory usage in megabytes */
|
||||
memoryMB: number;
|
||||
/** CPU usage percentage */
|
||||
cpuPercent: number;
|
||||
/** Number of child processes */
|
||||
childCount: number;
|
||||
/** Timestamp of stats collection */
|
||||
updatedAt: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A single plan item for plan orchestration.
|
||||
* Moved here from plan-orchestrator.ts to break circular dependency.
|
||||
|
||||
Reference in New Issue
Block a user