diff --git a/.github/workflows/claude-issue-analysis.yml b/.github/workflows/claude-issue-analysis.yml index 26af513..c0c8674 100644 --- a/.github/workflows/claude-issue-analysis.yml +++ b/.github/workflows/claude-issue-analysis.yml @@ -44,7 +44,6 @@ jobs: uses: anthropics/claude-code-action@a017b830c03e23789b11fb69ed571ea61c12e45c # v1.0.30 with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} - track_progress: true prompt: | Analyze this issue for the cc-plugin-eval TypeScript evaluation framework. diff --git a/.github/workflows/claude-pr-review.yml b/.github/workflows/claude-pr-review.yml index e63af6c..c933e0c 100644 --- a/.github/workflows/claude-pr-review.yml +++ b/.github/workflows/claude-pr-review.yml @@ -72,6 +72,7 @@ jobs: - `npm run typecheck` - TypeScript errors - `npm run lint` - ESLint issues - `npm run format:check` - Formatting + - `npm run knip` - Dead code detection ### Step 2: Review the Diff Run `gh pr diff ${{ github.event.pull_request.number }}` to see all changes. @@ -120,4 +121,4 @@ jobs: - **Suggestions**: General improvements (not covered by inline comments) Be constructive. Focus on significant issues, not nitpicks. - claude_args: '--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr comment:*),Bash(npm run typecheck),Bash(npm run lint),Bash(npm run format),Bash(npm run format:check),Bash(npm test),Bash(npm test:*),Read,Glob,Grep"' + claude_args: '--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr comment:*),Bash(npm run typecheck),Bash(npm run lint),Bash(npm run format),Bash(npm run format:check),Bash(npm run knip),Bash(npm test),Bash(npm test:*),Read,Glob,Grep"' diff --git a/CLAUDE.md b/CLAUDE.md index 576353a..e771430 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -209,7 +209,7 @@ export async function fetchData(url: string) { **Refactoring types**: Use `find_referencing_symbols` on a type from `src/types/` to find all usages before making changes. -**Tracing detection logic**: Detection is in `src/stages/4-evaluation/detection/`. The flow is `detectAllComponents` (in `core.ts`) → `detectFromCaptures` (in `capture-detection.ts`) → type-specific detectors (`agents.ts`, `commands.ts`, `hooks.ts`). Agent detection uses SubagentStart/SubagentStop hooks. Use `find_symbol` to navigate this chain. +**Tracing detection logic**: Detection is in `src/stages/4-evaluation/detection/`. The flow is `detectAllComponents` (in `orchestrator.ts`) → `detectFromCaptures` (in `capture-detection.ts`) → type-specific detectors (`agents.ts`, `commands.ts`, `hooks.ts`). Agent detection uses SubagentStart/SubagentStop hooks. Use `find_symbol` to navigate this chain. **Adding a new component type**: Follow the type through all four stages using `find_referencing_symbols` on similar component types (e.g., trace how `hooks` is handled to understand where to add `mcp_servers`). @@ -289,7 +289,7 @@ src/ │ └── detection/ # Decomposed detection logic ├── state/ # Resume capability, checkpointing │ ├── index.ts # State exports -│ ├── core.ts # Core state operations +│ ├── operations.ts # State CRUD operations │ ├── queries.ts # State query utilities │ ├── updates.ts # State update operations │ ├── display.ts # State display formatting @@ -312,15 +312,15 @@ When adding support for a new plugin component type (e.g., a new kind of trigger 1. Define types in `src/types/` 2. Create analyzer in `src/stages/1-analysis/` 3. Create scenario generator in `src/stages/2-generation/` -4. Add detector in `src/stages/4-evaluation/detection/` (create new file, add to `core.ts`) +4. Add detector in `src/stages/4-evaluation/detection/` (create new file, add to \`orchestrator.ts\`) 5. Update `AnalysisOutput` in `src/types/state.ts` 6. Add to pipeline in `src/stages/{1,2,4}-*/index.ts` -7. Add state migration in `src/state/core.ts` (provide defaults for legacy state) +7. Add state migration in \`src/state/operations.ts\` (provide defaults for legacy state) 8. Add tests ### State Migration -When adding new component types, update `migrateState()` in `src/state/core.ts` to provide defaults (e.g., `hooks: legacyComponents.hooks ?? []`) so existing state files remain compatible. +When adding new component types, update `migrateState()` in \`src/state/operations.ts\` to provide defaults (e.g., `hooks: legacyComponents.hooks ?? []`) so existing state files remain compatible. ### Resume Handlers diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20454df..724fcde 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,7 +55,7 @@ src/ │ └── 4-evaluation/ # Programmatic detection, LLM judge, metrics │ └── detection/ # Decomposed detection logic ├── state/ # Resume capability, checkpointing -│ ├── core.ts # Core state operations +│ ├── operations.ts # State CRUD operations │ ├── queries.ts # State query utilities │ └── updates.ts # State update operations ├── types/ # TypeScript interfaces diff --git a/README.md b/README.md index 902e6a1..85c4b2b 100644 --- a/README.md +++ b/README.md @@ -476,7 +476,7 @@ src/ │ ├── aggregation/ # Result aggregation utilities │ └── detection/ # Programmatic detection │ ├── index.ts # Detection entry point -│ ├── core.ts # Core detection logic +│ ├── orchestrator.ts # Detection orchestration │ ├── agents.ts # Agent detection │ ├── commands.ts # Command detection │ ├── hooks.ts # Hook detection @@ -486,7 +486,7 @@ src/ │ └── types.ts ├── state/ # Resume capability │ ├── index.ts # State exports -│ ├── core.ts # Core state operations +│ ├── operations.ts # State CRUD operations │ ├── queries.ts # State query utilities │ ├── updates.ts # State update operations │ ├── display.ts # State display formatting diff --git a/knip.json b/knip.json index 999c906..d19dda4 100644 --- a/knip.json +++ b/knip.json @@ -5,6 +5,7 @@ "ignore": ["dist/**", "coverage/**", "node_modules/**"], "ignoreDependencies": [], "ignoreExportsUsedInFile": true, + "tags": ["-internal"], "vitest": { "entry": ["tests/**/*.test.ts", "tests/**/*.spec.ts", "vitest.config.ts"], "project": ["tests/**/*.ts"] diff --git a/src/config/index.ts b/src/config/index.ts index d3788b1..8d1b54a 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -21,7 +21,6 @@ export { ExecutionConfigSchema, EvaluationConfigSchema, OutputConfigSchema, - type ValidatedEvalConfig, } from "./schema.js"; export { diff --git a/src/config/schema.ts b/src/config/schema.ts index f67dee3..ad5f876 100644 --- a/src/config/schema.ts +++ b/src/config/schema.ts @@ -314,8 +314,3 @@ export const EvalConfigSchema = z.object({ verbose: z.boolean().default(false), max_concurrent: z.number().int().min(1).max(50).default(10), }); - -/** - * Type inference from schema. - */ -export type ValidatedEvalConfig = z.infer; diff --git a/src/stages/4-evaluation/detection/index.ts b/src/stages/4-evaluation/detection/index.ts index 88a874f..90ec5cd 100644 --- a/src/stages/4-evaluation/detection/index.ts +++ b/src/stages/4-evaluation/detection/index.ts @@ -8,7 +8,10 @@ */ // Core detection functions -export { detectAllComponents, detectAllComponentsWithHooks } from "./core.js"; +export { + detectAllComponents, + detectAllComponentsWithHooks, +} from "./orchestrator.js"; // Capture-based detection export { diff --git a/src/stages/4-evaluation/detection/core.ts b/src/stages/4-evaluation/detection/orchestrator.ts similarity index 98% rename from src/stages/4-evaluation/detection/core.ts rename to src/stages/4-evaluation/detection/orchestrator.ts index c6e5991..532f0fa 100644 --- a/src/stages/4-evaluation/detection/core.ts +++ b/src/stages/4-evaluation/detection/orchestrator.ts @@ -1,5 +1,5 @@ /** - * Core Detection - Main detection orchestration. + * Detection orchestration - Main detection entry points. * * Provides the main entry points for component detection, combining * all detection methods with proper priority ordering. diff --git a/src/state/index.ts b/src/state/index.ts index 4987d31..28b9ebd 100644 --- a/src/state/index.ts +++ b/src/state/index.ts @@ -12,7 +12,7 @@ * * This module re-exports all state management functionality from focused submodules: * - types: Shared type definitions (PipelineState, PipelineStage, etc.) - * - core: CRUD operations (create, save, load, paths) + * - operations: CRUD operations (create, save, load, paths) * - updates: State update functions (updateStateAfter*, etc.) * - queries: Query helpers (canResumeFrom, get*Scenarios, etc.) * - display: Formatting and listing (formatState, listRuns) @@ -23,7 +23,6 @@ export type { CreateRunOptions, PipelineStage, PipelineState, - ResumeOptions, } from "./types.js"; // Re-export core operations @@ -34,7 +33,7 @@ export { getStateFilePath, loadState, saveState, -} from "./core.js"; +} from "./operations.js"; // Re-export update operations export { diff --git a/src/state/core.ts b/src/state/operations.ts similarity index 99% rename from src/state/core.ts rename to src/state/operations.ts index b181c43..ec67b4d 100644 --- a/src/state/core.ts +++ b/src/state/operations.ts @@ -1,5 +1,5 @@ /** - * Core state management operations. + * State CRUD operations. * * Handles CRUD operations (create, save, load) and state file management. * All functions in this module are pure or have clearly documented side effects. diff --git a/src/state/types.ts b/src/state/types.ts index bdf246c..ac4b44a 100644 --- a/src/state/types.ts +++ b/src/state/types.ts @@ -77,11 +77,3 @@ export interface CreateRunOptions { config: EvalConfig; runId?: string; } - -/** - * Options for resuming a pipeline run. - */ -export interface ResumeOptions { - runId: string; - fromStage?: PipelineStage; -}