agentsys 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agnix.toml +49 -0
- package/.claude-plugin/marketplace.json +110 -0
- package/.claude-plugin/plugin.json +20 -0
- package/AGENTS.md +260 -0
- package/CHANGELOG.md +190 -0
- package/LICENSE +21 -0
- package/README.md +916 -0
- package/SECURITY.md +45 -0
- package/adapters/README.md +258 -0
- package/adapters/codex/README.md +273 -0
- package/adapters/codex/install.sh +260 -0
- package/adapters/codex/skills/agnix/SKILL.md +138 -0
- package/adapters/codex/skills/audit-project/SKILL.md +334 -0
- package/adapters/codex/skills/audit-project-agents/SKILL.md +459 -0
- package/adapters/codex/skills/audit-project-github/SKILL.md +146 -0
- package/adapters/codex/skills/consult/SKILL.md +245 -0
- package/adapters/codex/skills/delivery-approval/SKILL.md +339 -0
- package/adapters/codex/skills/deslop/SKILL.md +167 -0
- package/adapters/codex/skills/drift-detect/SKILL.md +268 -0
- package/adapters/codex/skills/enhance/SKILL.md +177 -0
- package/adapters/codex/skills/learn/SKILL.md +188 -0
- package/adapters/codex/skills/next-task/SKILL.md +546 -0
- package/adapters/codex/skills/perf/SKILL.md +469 -0
- package/adapters/codex/skills/repo-map/SKILL.md +132 -0
- package/adapters/codex/skills/ship/SKILL.md +491 -0
- package/adapters/codex/skills/ship-ci-review-loop/SKILL.md +473 -0
- package/adapters/codex/skills/ship-deployment/SKILL.md +336 -0
- package/adapters/codex/skills/ship-error-handling/SKILL.md +260 -0
- package/adapters/codex/skills/sync-docs/SKILL.md +186 -0
- package/adapters/opencode/README.md +302 -0
- package/adapters/opencode/agents/agent-enhancer.md +65 -0
- package/adapters/opencode/agents/agnix-agent.md +56 -0
- package/adapters/opencode/agents/ci-fixer.md +104 -0
- package/adapters/opencode/agents/ci-monitor.md +127 -0
- package/adapters/opencode/agents/claudemd-enhancer.md +66 -0
- package/adapters/opencode/agents/consult-agent.md +124 -0
- package/adapters/opencode/agents/cross-file-enhancer.md +54 -0
- package/adapters/opencode/agents/delivery-validator.md +115 -0
- package/adapters/opencode/agents/deslop-agent.md +88 -0
- package/adapters/opencode/agents/docs-enhancer.md +65 -0
- package/adapters/opencode/agents/exploration-agent.md +143 -0
- package/adapters/opencode/agents/hooks-enhancer.md +66 -0
- package/adapters/opencode/agents/implementation-agent.md +206 -0
- package/adapters/opencode/agents/learn-agent.md +279 -0
- package/adapters/opencode/agents/map-validator.md +65 -0
- package/adapters/opencode/agents/perf-analyzer.md +40 -0
- package/adapters/opencode/agents/perf-code-paths.md +12 -0
- package/adapters/opencode/agents/perf-investigation-logger.md +44 -0
- package/adapters/opencode/agents/perf-orchestrator.md +147 -0
- package/adapters/opencode/agents/perf-theory-gatherer.md +18 -0
- package/adapters/opencode/agents/perf-theory-tester.md +43 -0
- package/adapters/opencode/agents/plan-synthesizer.md +229 -0
- package/adapters/opencode/agents/planning-agent.md +235 -0
- package/adapters/opencode/agents/plugin-enhancer.md +64 -0
- package/adapters/opencode/agents/prompt-enhancer.md +58 -0
- package/adapters/opencode/agents/simple-fixer.md +107 -0
- package/adapters/opencode/agents/skills-enhancer.md +66 -0
- package/adapters/opencode/agents/sync-docs-agent.md +153 -0
- package/adapters/opencode/agents/task-discoverer.md +80 -0
- package/adapters/opencode/agents/test-coverage-checker.md +144 -0
- package/adapters/opencode/agents/worktree-manager.md +209 -0
- package/adapters/opencode/commands/agnix.md +106 -0
- package/adapters/opencode/commands/audit-project-agents.md +125 -0
- package/adapters/opencode/commands/audit-project-github.md +145 -0
- package/adapters/opencode/commands/audit-project.md +268 -0
- package/adapters/opencode/commands/consult.md +252 -0
- package/adapters/opencode/commands/delivery-approval.md +212 -0
- package/adapters/opencode/commands/deslop.md +132 -0
- package/adapters/opencode/commands/drift-detect.md +173 -0
- package/adapters/opencode/commands/enhance.md +183 -0
- package/adapters/opencode/commands/learn.md +116 -0
- package/adapters/opencode/commands/next-task.md +393 -0
- package/adapters/opencode/commands/perf.md +49 -0
- package/adapters/opencode/commands/repo-map.md +69 -0
- package/adapters/opencode/commands/ship-ci-review-loop.md +334 -0
- package/adapters/opencode/commands/ship-deployment.md +336 -0
- package/adapters/opencode/commands/ship-error-handling.md +248 -0
- package/adapters/opencode/commands/ship.md +371 -0
- package/adapters/opencode/commands/sync-docs.md +108 -0
- package/adapters/opencode/install.sh +322 -0
- package/adapters/opencode/skills/agnix/SKILL.md +139 -0
- package/adapters/opencode/skills/consult/SKILL.md +292 -0
- package/adapters/opencode/skills/deslop/SKILL.md +169 -0
- package/adapters/opencode/skills/discover-tasks/SKILL.md +102 -0
- package/adapters/opencode/skills/drift-analysis/SKILL.md +279 -0
- package/adapters/opencode/skills/enhance-agent-prompts/SKILL.md +279 -0
- package/adapters/opencode/skills/enhance-claude-memory/SKILL.md +390 -0
- package/adapters/opencode/skills/enhance-cross-file/SKILL.md +112 -0
- package/adapters/opencode/skills/enhance-docs/SKILL.md +288 -0
- package/adapters/opencode/skills/enhance-hooks/SKILL.md +557 -0
- package/adapters/opencode/skills/enhance-orchestrator/SKILL.md +114 -0
- package/adapters/opencode/skills/enhance-plugins/SKILL.md +314 -0
- package/adapters/opencode/skills/enhance-prompts/SKILL.md +341 -0
- package/adapters/opencode/skills/enhance-skills/SKILL.md +443 -0
- package/adapters/opencode/skills/learn/SKILL.md +352 -0
- package/adapters/opencode/skills/orchestrate-review/SKILL.md +95 -0
- package/adapters/opencode/skills/perf-analyzer/SKILL.md +38 -0
- package/adapters/opencode/skills/perf-baseline-manager/SKILL.md +31 -0
- package/adapters/opencode/skills/perf-benchmarker/SKILL.md +49 -0
- package/adapters/opencode/skills/perf-code-paths/SKILL.md +33 -0
- package/adapters/opencode/skills/perf-investigation-logger/SKILL.md +42 -0
- package/adapters/opencode/skills/perf-profiler/SKILL.md +39 -0
- package/adapters/opencode/skills/perf-theory-gatherer/SKILL.md +36 -0
- package/adapters/opencode/skills/perf-theory-tester/SKILL.md +37 -0
- package/adapters/opencode/skills/repo-mapping/SKILL.md +86 -0
- package/adapters/opencode/skills/sync-docs/SKILL.md +246 -0
- package/adapters/opencode/skills/validate-delivery/SKILL.md +112 -0
- package/adapters/opencode-plugin/index.ts +346 -0
- package/adapters/opencode-plugin/package.json +21 -0
- package/agent-knowledge/AGENTS.md +62 -0
- package/agent-knowledge/ai-cli-advanced-integration-patterns.md +670 -0
- package/agent-knowledge/ai-cli-non-interactive-programmatic-usage.md +1394 -0
- package/agent-knowledge/resources/ai-cli-non-interactive-programmatic-usage-sources.json +500 -0
- package/bin/cli.js +719 -0
- package/bin/dev-cli.js +587 -0
- package/lib/adapter-transforms.js +278 -0
- package/lib/collectors/codebase.js +392 -0
- package/lib/collectors/docs-patterns.js +713 -0
- package/lib/collectors/documentation.js +219 -0
- package/lib/collectors/github.js +266 -0
- package/lib/collectors/index.js +126 -0
- package/lib/config/index.js +14 -0
- package/lib/cross-platform/index.js +539 -0
- package/lib/discovery/index.js +352 -0
- package/lib/drift-detect/collectors.js +37 -0
- package/lib/enhance/agent-analyzer.js +421 -0
- package/lib/enhance/agent-patterns.js +571 -0
- package/lib/enhance/auto-suppression.js +622 -0
- package/lib/enhance/benchmark.js +417 -0
- package/lib/enhance/cross-file-analyzer.js +930 -0
- package/lib/enhance/cross-file-patterns.js +370 -0
- package/lib/enhance/docs-analyzer.js +325 -0
- package/lib/enhance/docs-patterns.js +671 -0
- package/lib/enhance/fixer.js +721 -0
- package/lib/enhance/hook-analyzer.js +135 -0
- package/lib/enhance/hook-patterns.js +40 -0
- package/lib/enhance/index.js +127 -0
- package/lib/enhance/plugin-analyzer.js +402 -0
- package/lib/enhance/plugin-patterns.js +326 -0
- package/lib/enhance/projectmemory-analyzer.js +551 -0
- package/lib/enhance/projectmemory-patterns.js +617 -0
- package/lib/enhance/prompt-analyzer.js +457 -0
- package/lib/enhance/prompt-patterns.js +1484 -0
- package/lib/enhance/reporter.js +1348 -0
- package/lib/enhance/security-patterns.js +284 -0
- package/lib/enhance/skill-analyzer.js +182 -0
- package/lib/enhance/skill-patterns.js +147 -0
- package/lib/enhance/suppression.js +352 -0
- package/lib/enhance/tool-patterns.js +373 -0
- package/lib/index.js +270 -0
- package/lib/package.json +25 -0
- package/lib/patterns/cli-enhancers.js +611 -0
- package/lib/patterns/pipeline.js +948 -0
- package/lib/patterns/review-patterns.js +558 -0
- package/lib/patterns/slop-analyzers.js +2305 -0
- package/lib/patterns/slop-patterns.js +1187 -0
- package/lib/perf/analyzer/index.js +22 -0
- package/lib/perf/argument-parser.js +105 -0
- package/lib/perf/baseline-comparator.js +50 -0
- package/lib/perf/baseline-store.js +127 -0
- package/lib/perf/benchmark-runner.js +399 -0
- package/lib/perf/breaking-point-finder.js +52 -0
- package/lib/perf/breaking-point-runner.js +60 -0
- package/lib/perf/checkpoint.js +123 -0
- package/lib/perf/code-paths.js +86 -0
- package/lib/perf/consolidation.js +37 -0
- package/lib/perf/constraint-runner.js +71 -0
- package/lib/perf/experiment-runner.js +32 -0
- package/lib/perf/index.js +41 -0
- package/lib/perf/investigation-state.js +875 -0
- package/lib/perf/optimization-runner.js +79 -0
- package/lib/perf/profilers/go.js +22 -0
- package/lib/perf/profilers/index.js +46 -0
- package/lib/perf/profilers/java.js +23 -0
- package/lib/perf/profilers/node.js +27 -0
- package/lib/perf/profilers/python.js +23 -0
- package/lib/perf/profilers/rust.js +23 -0
- package/lib/perf/profiling-runner.js +56 -0
- package/lib/perf/schemas.js +140 -0
- package/lib/platform/detect-platform.js +413 -0
- package/lib/platform/detection-configs.js +93 -0
- package/lib/platform/state-dir.js +132 -0
- package/lib/platform/verify-tools.js +182 -0
- package/lib/repo-map/cache.js +152 -0
- package/lib/repo-map/index.js +222 -0
- package/lib/repo-map/installer.js +212 -0
- package/lib/repo-map/queries/go.js +27 -0
- package/lib/repo-map/queries/index.js +100 -0
- package/lib/repo-map/queries/java.js +38 -0
- package/lib/repo-map/queries/javascript.js +55 -0
- package/lib/repo-map/queries/python.js +24 -0
- package/lib/repo-map/queries/rust.js +73 -0
- package/lib/repo-map/queries/typescript.js +38 -0
- package/lib/repo-map/runner.js +1165 -0
- package/lib/repo-map/updater.js +474 -0
- package/lib/repo-map/usage-analyzer.js +407 -0
- package/lib/schemas/plugin-manifest.schema.json +57 -0
- package/lib/schemas/validator.js +247 -0
- package/lib/sources/custom-handler.js +199 -0
- package/lib/sources/policy-questions.js +246 -0
- package/lib/sources/source-cache.js +165 -0
- package/lib/state/workflow-state.js +575 -0
- package/lib/types/agent-frontmatter.d.ts +134 -0
- package/lib/types/command-frontmatter.d.ts +107 -0
- package/lib/types/hook-frontmatter.d.ts +115 -0
- package/lib/types/index.d.ts +84 -0
- package/lib/types/plugin-manifest.d.ts +102 -0
- package/lib/types/skill-frontmatter.d.ts +89 -0
- package/lib/utils/atomic-write.js +94 -0
- package/lib/utils/cache-manager.js +159 -0
- package/lib/utils/context-optimizer.js +300 -0
- package/lib/utils/deprecation.js +37 -0
- package/lib/utils/shell-escape.js +88 -0
- package/meta/skills/maintain-cross-platform/SKILL.md +1022 -0
- package/package.json +92 -0
- package/plugins/agnix/.claude-plugin/plugin.json +22 -0
- package/plugins/agnix/agents/agnix-agent.md +56 -0
- package/plugins/agnix/commands/agnix.md +139 -0
- package/plugins/agnix/skills/agnix/SKILL.md +138 -0
- package/plugins/audit-project/.claude-plugin/plugin.json +20 -0
- package/plugins/audit-project/commands/audit-project-agents.md +458 -0
- package/plugins/audit-project/commands/audit-project-github.md +144 -0
- package/plugins/audit-project/commands/audit-project.md +336 -0
- package/plugins/audit-project/lib/adapter-transforms.js +278 -0
- package/plugins/audit-project/lib/collectors/codebase.js +392 -0
- package/plugins/audit-project/lib/collectors/docs-patterns.js +713 -0
- package/plugins/audit-project/lib/collectors/documentation.js +219 -0
- package/plugins/audit-project/lib/collectors/github.js +266 -0
- package/plugins/audit-project/lib/collectors/index.js +126 -0
- package/plugins/audit-project/lib/config/index.js +14 -0
- package/plugins/audit-project/lib/cross-platform/index.js +539 -0
- package/plugins/audit-project/lib/discovery/index.js +352 -0
- package/plugins/audit-project/lib/drift-detect/collectors.js +37 -0
- package/plugins/audit-project/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/audit-project/lib/enhance/agent-patterns.js +571 -0
- package/plugins/audit-project/lib/enhance/auto-suppression.js +622 -0
- package/plugins/audit-project/lib/enhance/benchmark.js +417 -0
- package/plugins/audit-project/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/audit-project/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/audit-project/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/audit-project/lib/enhance/docs-patterns.js +671 -0
- package/plugins/audit-project/lib/enhance/fixer.js +721 -0
- package/plugins/audit-project/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/audit-project/lib/enhance/hook-patterns.js +40 -0
- package/plugins/audit-project/lib/enhance/index.js +127 -0
- package/plugins/audit-project/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/audit-project/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/audit-project/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/audit-project/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/audit-project/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/audit-project/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/audit-project/lib/enhance/reporter.js +1348 -0
- package/plugins/audit-project/lib/enhance/security-patterns.js +284 -0
- package/plugins/audit-project/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/audit-project/lib/enhance/skill-patterns.js +147 -0
- package/plugins/audit-project/lib/enhance/suppression.js +352 -0
- package/plugins/audit-project/lib/enhance/tool-patterns.js +373 -0
- package/plugins/audit-project/lib/index.js +270 -0
- package/plugins/audit-project/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/audit-project/lib/patterns/pipeline.js +948 -0
- package/plugins/audit-project/lib/patterns/review-patterns.js +558 -0
- package/plugins/audit-project/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/audit-project/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/audit-project/lib/perf/analyzer/index.js +22 -0
- package/plugins/audit-project/lib/perf/argument-parser.js +105 -0
- package/plugins/audit-project/lib/perf/baseline-comparator.js +50 -0
- package/plugins/audit-project/lib/perf/baseline-store.js +127 -0
- package/plugins/audit-project/lib/perf/benchmark-runner.js +399 -0
- package/plugins/audit-project/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/audit-project/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/audit-project/lib/perf/checkpoint.js +123 -0
- package/plugins/audit-project/lib/perf/code-paths.js +86 -0
- package/plugins/audit-project/lib/perf/consolidation.js +37 -0
- package/plugins/audit-project/lib/perf/constraint-runner.js +71 -0
- package/plugins/audit-project/lib/perf/experiment-runner.js +32 -0
- package/plugins/audit-project/lib/perf/index.js +41 -0
- package/plugins/audit-project/lib/perf/investigation-state.js +875 -0
- package/plugins/audit-project/lib/perf/optimization-runner.js +79 -0
- package/plugins/audit-project/lib/perf/profilers/go.js +22 -0
- package/plugins/audit-project/lib/perf/profilers/index.js +46 -0
- package/plugins/audit-project/lib/perf/profilers/java.js +23 -0
- package/plugins/audit-project/lib/perf/profilers/node.js +27 -0
- package/plugins/audit-project/lib/perf/profilers/python.js +23 -0
- package/plugins/audit-project/lib/perf/profilers/rust.js +23 -0
- package/plugins/audit-project/lib/perf/profiling-runner.js +56 -0
- package/plugins/audit-project/lib/perf/schemas.js +140 -0
- package/plugins/audit-project/lib/platform/detect-platform.js +413 -0
- package/plugins/audit-project/lib/platform/detection-configs.js +93 -0
- package/plugins/audit-project/lib/platform/state-dir.js +132 -0
- package/plugins/audit-project/lib/platform/verify-tools.js +182 -0
- package/plugins/audit-project/lib/repo-map/cache.js +152 -0
- package/plugins/audit-project/lib/repo-map/index.js +222 -0
- package/plugins/audit-project/lib/repo-map/installer.js +212 -0
- package/plugins/audit-project/lib/repo-map/queries/go.js +27 -0
- package/plugins/audit-project/lib/repo-map/queries/index.js +100 -0
- package/plugins/audit-project/lib/repo-map/queries/java.js +38 -0
- package/plugins/audit-project/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/audit-project/lib/repo-map/queries/python.js +24 -0
- package/plugins/audit-project/lib/repo-map/queries/rust.js +73 -0
- package/plugins/audit-project/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/audit-project/lib/repo-map/runner.js +1165 -0
- package/plugins/audit-project/lib/repo-map/updater.js +474 -0
- package/plugins/audit-project/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/audit-project/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/audit-project/lib/schemas/validator.js +247 -0
- package/plugins/audit-project/lib/sources/custom-handler.js +199 -0
- package/plugins/audit-project/lib/sources/policy-questions.js +246 -0
- package/plugins/audit-project/lib/sources/source-cache.js +165 -0
- package/plugins/audit-project/lib/state/workflow-state.js +575 -0
- package/plugins/audit-project/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/audit-project/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/audit-project/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/audit-project/lib/types/index.d.ts +84 -0
- package/plugins/audit-project/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/audit-project/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/audit-project/lib/utils/atomic-write.js +94 -0
- package/plugins/audit-project/lib/utils/cache-manager.js +159 -0
- package/plugins/audit-project/lib/utils/context-optimizer.js +300 -0
- package/plugins/audit-project/lib/utils/deprecation.js +37 -0
- package/plugins/audit-project/lib/utils/shell-escape.js +88 -0
- package/plugins/consult/.claude-plugin/plugin.json +24 -0
- package/plugins/consult/agents/consult-agent.md +129 -0
- package/plugins/consult/commands/consult.md +248 -0
- package/plugins/consult/skills/consult/SKILL.md +285 -0
- package/plugins/deslop/.claude-plugin/plugin.json +20 -0
- package/plugins/deslop/agents/deslop-agent.md +88 -0
- package/plugins/deslop/commands/deslop.md +168 -0
- package/plugins/deslop/lib/adapter-transforms.js +278 -0
- package/plugins/deslop/lib/collectors/codebase.js +392 -0
- package/plugins/deslop/lib/collectors/docs-patterns.js +713 -0
- package/plugins/deslop/lib/collectors/documentation.js +219 -0
- package/plugins/deslop/lib/collectors/github.js +266 -0
- package/plugins/deslop/lib/collectors/index.js +126 -0
- package/plugins/deslop/lib/config/index.js +14 -0
- package/plugins/deslop/lib/cross-platform/index.js +539 -0
- package/plugins/deslop/lib/discovery/index.js +352 -0
- package/plugins/deslop/lib/drift-detect/collectors.js +37 -0
- package/plugins/deslop/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/deslop/lib/enhance/agent-patterns.js +571 -0
- package/plugins/deslop/lib/enhance/auto-suppression.js +622 -0
- package/plugins/deslop/lib/enhance/benchmark.js +417 -0
- package/plugins/deslop/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/deslop/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/deslop/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/deslop/lib/enhance/docs-patterns.js +671 -0
- package/plugins/deslop/lib/enhance/fixer.js +721 -0
- package/plugins/deslop/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/deslop/lib/enhance/hook-patterns.js +40 -0
- package/plugins/deslop/lib/enhance/index.js +127 -0
- package/plugins/deslop/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/deslop/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/deslop/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/deslop/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/deslop/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/deslop/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/deslop/lib/enhance/reporter.js +1348 -0
- package/plugins/deslop/lib/enhance/security-patterns.js +284 -0
- package/plugins/deslop/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/deslop/lib/enhance/skill-patterns.js +147 -0
- package/plugins/deslop/lib/enhance/suppression.js +352 -0
- package/plugins/deslop/lib/enhance/tool-patterns.js +373 -0
- package/plugins/deslop/lib/index.js +270 -0
- package/plugins/deslop/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/deslop/lib/patterns/pipeline.js +948 -0
- package/plugins/deslop/lib/patterns/review-patterns.js +558 -0
- package/plugins/deslop/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/deslop/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/deslop/lib/perf/analyzer/index.js +22 -0
- package/plugins/deslop/lib/perf/argument-parser.js +105 -0
- package/plugins/deslop/lib/perf/baseline-comparator.js +50 -0
- package/plugins/deslop/lib/perf/baseline-store.js +127 -0
- package/plugins/deslop/lib/perf/benchmark-runner.js +399 -0
- package/plugins/deslop/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/deslop/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/deslop/lib/perf/checkpoint.js +123 -0
- package/plugins/deslop/lib/perf/code-paths.js +86 -0
- package/plugins/deslop/lib/perf/consolidation.js +37 -0
- package/plugins/deslop/lib/perf/constraint-runner.js +71 -0
- package/plugins/deslop/lib/perf/experiment-runner.js +32 -0
- package/plugins/deslop/lib/perf/index.js +41 -0
- package/plugins/deslop/lib/perf/investigation-state.js +875 -0
- package/plugins/deslop/lib/perf/optimization-runner.js +79 -0
- package/plugins/deslop/lib/perf/profilers/go.js +22 -0
- package/plugins/deslop/lib/perf/profilers/index.js +46 -0
- package/plugins/deslop/lib/perf/profilers/java.js +23 -0
- package/plugins/deslop/lib/perf/profilers/node.js +27 -0
- package/plugins/deslop/lib/perf/profilers/python.js +23 -0
- package/plugins/deslop/lib/perf/profilers/rust.js +23 -0
- package/plugins/deslop/lib/perf/profiling-runner.js +56 -0
- package/plugins/deslop/lib/perf/schemas.js +140 -0
- package/plugins/deslop/lib/platform/detect-platform.js +413 -0
- package/plugins/deslop/lib/platform/detection-configs.js +93 -0
- package/plugins/deslop/lib/platform/state-dir.js +132 -0
- package/plugins/deslop/lib/platform/verify-tools.js +182 -0
- package/plugins/deslop/lib/repo-map/cache.js +152 -0
- package/plugins/deslop/lib/repo-map/index.js +222 -0
- package/plugins/deslop/lib/repo-map/installer.js +212 -0
- package/plugins/deslop/lib/repo-map/queries/go.js +27 -0
- package/plugins/deslop/lib/repo-map/queries/index.js +100 -0
- package/plugins/deslop/lib/repo-map/queries/java.js +38 -0
- package/plugins/deslop/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/deslop/lib/repo-map/queries/python.js +24 -0
- package/plugins/deslop/lib/repo-map/queries/rust.js +73 -0
- package/plugins/deslop/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/deslop/lib/repo-map/runner.js +1165 -0
- package/plugins/deslop/lib/repo-map/updater.js +474 -0
- package/plugins/deslop/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/deslop/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/deslop/lib/schemas/validator.js +247 -0
- package/plugins/deslop/lib/sources/custom-handler.js +199 -0
- package/plugins/deslop/lib/sources/policy-questions.js +246 -0
- package/plugins/deslop/lib/sources/source-cache.js +165 -0
- package/plugins/deslop/lib/state/workflow-state.js +575 -0
- package/plugins/deslop/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/deslop/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/deslop/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/deslop/lib/types/index.d.ts +84 -0
- package/plugins/deslop/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/deslop/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/deslop/lib/utils/atomic-write.js +94 -0
- package/plugins/deslop/lib/utils/cache-manager.js +159 -0
- package/plugins/deslop/lib/utils/context-optimizer.js +300 -0
- package/plugins/deslop/lib/utils/deprecation.js +37 -0
- package/plugins/deslop/lib/utils/shell-escape.js +88 -0
- package/plugins/deslop/references/slop-categories.md +122 -0
- package/plugins/deslop/scripts/detect.js +134 -0
- package/plugins/deslop/skills/deslop/SKILL.md +204 -0
- package/plugins/drift-detect/.claude-plugin/plugin.json +23 -0
- package/plugins/drift-detect/agents/plan-synthesizer.md +225 -0
- package/plugins/drift-detect/commands/drift-detect.md +269 -0
- package/plugins/drift-detect/lib/adapter-transforms.js +278 -0
- package/plugins/drift-detect/lib/collectors/codebase.js +392 -0
- package/plugins/drift-detect/lib/collectors/docs-patterns.js +713 -0
- package/plugins/drift-detect/lib/collectors/documentation.js +219 -0
- package/plugins/drift-detect/lib/collectors/github.js +266 -0
- package/plugins/drift-detect/lib/collectors/index.js +126 -0
- package/plugins/drift-detect/lib/config/index.js +14 -0
- package/plugins/drift-detect/lib/cross-platform/index.js +539 -0
- package/plugins/drift-detect/lib/discovery/index.js +352 -0
- package/plugins/drift-detect/lib/drift-detect/collectors.js +37 -0
- package/plugins/drift-detect/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/drift-detect/lib/enhance/agent-patterns.js +571 -0
- package/plugins/drift-detect/lib/enhance/auto-suppression.js +622 -0
- package/plugins/drift-detect/lib/enhance/benchmark.js +417 -0
- package/plugins/drift-detect/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/drift-detect/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/drift-detect/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/drift-detect/lib/enhance/docs-patterns.js +671 -0
- package/plugins/drift-detect/lib/enhance/fixer.js +721 -0
- package/plugins/drift-detect/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/drift-detect/lib/enhance/hook-patterns.js +40 -0
- package/plugins/drift-detect/lib/enhance/index.js +127 -0
- package/plugins/drift-detect/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/drift-detect/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/drift-detect/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/drift-detect/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/drift-detect/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/drift-detect/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/drift-detect/lib/enhance/reporter.js +1348 -0
- package/plugins/drift-detect/lib/enhance/security-patterns.js +284 -0
- package/plugins/drift-detect/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/drift-detect/lib/enhance/skill-patterns.js +147 -0
- package/plugins/drift-detect/lib/enhance/suppression.js +352 -0
- package/plugins/drift-detect/lib/enhance/tool-patterns.js +373 -0
- package/plugins/drift-detect/lib/index.js +270 -0
- package/plugins/drift-detect/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/drift-detect/lib/patterns/pipeline.js +948 -0
- package/plugins/drift-detect/lib/patterns/review-patterns.js +558 -0
- package/plugins/drift-detect/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/drift-detect/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/drift-detect/lib/perf/analyzer/index.js +22 -0
- package/plugins/drift-detect/lib/perf/argument-parser.js +105 -0
- package/plugins/drift-detect/lib/perf/baseline-comparator.js +50 -0
- package/plugins/drift-detect/lib/perf/baseline-store.js +127 -0
- package/plugins/drift-detect/lib/perf/benchmark-runner.js +399 -0
- package/plugins/drift-detect/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/drift-detect/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/drift-detect/lib/perf/checkpoint.js +123 -0
- package/plugins/drift-detect/lib/perf/code-paths.js +86 -0
- package/plugins/drift-detect/lib/perf/consolidation.js +37 -0
- package/plugins/drift-detect/lib/perf/constraint-runner.js +71 -0
- package/plugins/drift-detect/lib/perf/experiment-runner.js +32 -0
- package/plugins/drift-detect/lib/perf/index.js +41 -0
- package/plugins/drift-detect/lib/perf/investigation-state.js +875 -0
- package/plugins/drift-detect/lib/perf/optimization-runner.js +79 -0
- package/plugins/drift-detect/lib/perf/profilers/go.js +22 -0
- package/plugins/drift-detect/lib/perf/profilers/index.js +46 -0
- package/plugins/drift-detect/lib/perf/profilers/java.js +23 -0
- package/plugins/drift-detect/lib/perf/profilers/node.js +27 -0
- package/plugins/drift-detect/lib/perf/profilers/python.js +23 -0
- package/plugins/drift-detect/lib/perf/profilers/rust.js +23 -0
- package/plugins/drift-detect/lib/perf/profiling-runner.js +56 -0
- package/plugins/drift-detect/lib/perf/schemas.js +140 -0
- package/plugins/drift-detect/lib/platform/detect-platform.js +413 -0
- package/plugins/drift-detect/lib/platform/detection-configs.js +93 -0
- package/plugins/drift-detect/lib/platform/state-dir.js +132 -0
- package/plugins/drift-detect/lib/platform/verify-tools.js +182 -0
- package/plugins/drift-detect/lib/repo-map/cache.js +152 -0
- package/plugins/drift-detect/lib/repo-map/index.js +222 -0
- package/plugins/drift-detect/lib/repo-map/installer.js +212 -0
- package/plugins/drift-detect/lib/repo-map/queries/go.js +27 -0
- package/plugins/drift-detect/lib/repo-map/queries/index.js +100 -0
- package/plugins/drift-detect/lib/repo-map/queries/java.js +38 -0
- package/plugins/drift-detect/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/drift-detect/lib/repo-map/queries/python.js +24 -0
- package/plugins/drift-detect/lib/repo-map/queries/rust.js +73 -0
- package/plugins/drift-detect/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/drift-detect/lib/repo-map/runner.js +1165 -0
- package/plugins/drift-detect/lib/repo-map/updater.js +474 -0
- package/plugins/drift-detect/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/drift-detect/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/drift-detect/lib/schemas/validator.js +247 -0
- package/plugins/drift-detect/lib/sources/custom-handler.js +199 -0
- package/plugins/drift-detect/lib/sources/policy-questions.js +246 -0
- package/plugins/drift-detect/lib/sources/source-cache.js +165 -0
- package/plugins/drift-detect/lib/state/workflow-state.js +575 -0
- package/plugins/drift-detect/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/drift-detect/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/drift-detect/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/drift-detect/lib/types/index.d.ts +84 -0
- package/plugins/drift-detect/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/drift-detect/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/drift-detect/lib/utils/atomic-write.js +94 -0
- package/plugins/drift-detect/lib/utils/cache-manager.js +159 -0
- package/plugins/drift-detect/lib/utils/context-optimizer.js +300 -0
- package/plugins/drift-detect/lib/utils/deprecation.js +37 -0
- package/plugins/drift-detect/lib/utils/shell-escape.js +88 -0
- package/plugins/drift-detect/skills/drift-analysis/SKILL.md +324 -0
- package/plugins/enhance/.claude-plugin/plugin.json +20 -0
- package/plugins/enhance/agents/agent-enhancer.md +64 -0
- package/plugins/enhance/agents/claudemd-enhancer.md +65 -0
- package/plugins/enhance/agents/cross-file-enhancer.md +54 -0
- package/plugins/enhance/agents/docs-enhancer.md +64 -0
- package/plugins/enhance/agents/hooks-enhancer.md +64 -0
- package/plugins/enhance/agents/plugin-enhancer.md +63 -0
- package/plugins/enhance/agents/prompt-enhancer.md +58 -0
- package/plugins/enhance/agents/skills-enhancer.md +64 -0
- package/plugins/enhance/commands/enhance.md +178 -0
- package/plugins/enhance/lib/adapter-transforms.js +278 -0
- package/plugins/enhance/lib/collectors/codebase.js +392 -0
- package/plugins/enhance/lib/collectors/docs-patterns.js +713 -0
- package/plugins/enhance/lib/collectors/documentation.js +219 -0
- package/plugins/enhance/lib/collectors/github.js +266 -0
- package/plugins/enhance/lib/collectors/index.js +126 -0
- package/plugins/enhance/lib/config/index.js +14 -0
- package/plugins/enhance/lib/cross-platform/index.js +539 -0
- package/plugins/enhance/lib/discovery/index.js +352 -0
- package/plugins/enhance/lib/drift-detect/collectors.js +37 -0
- package/plugins/enhance/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/enhance/lib/enhance/agent-patterns.js +571 -0
- package/plugins/enhance/lib/enhance/auto-suppression.js +622 -0
- package/plugins/enhance/lib/enhance/benchmark.js +417 -0
- package/plugins/enhance/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/enhance/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/enhance/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/enhance/lib/enhance/docs-patterns.js +671 -0
- package/plugins/enhance/lib/enhance/fixer.js +721 -0
- package/plugins/enhance/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/enhance/lib/enhance/hook-patterns.js +40 -0
- package/plugins/enhance/lib/enhance/index.js +127 -0
- package/plugins/enhance/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/enhance/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/enhance/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/enhance/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/enhance/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/enhance/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/enhance/lib/enhance/reporter.js +1348 -0
- package/plugins/enhance/lib/enhance/security-patterns.js +284 -0
- package/plugins/enhance/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/enhance/lib/enhance/skill-patterns.js +147 -0
- package/plugins/enhance/lib/enhance/suppression.js +352 -0
- package/plugins/enhance/lib/enhance/tool-patterns.js +373 -0
- package/plugins/enhance/lib/index.js +270 -0
- package/plugins/enhance/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/enhance/lib/patterns/pipeline.js +948 -0
- package/plugins/enhance/lib/patterns/review-patterns.js +558 -0
- package/plugins/enhance/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/enhance/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/enhance/lib/perf/analyzer/index.js +22 -0
- package/plugins/enhance/lib/perf/argument-parser.js +105 -0
- package/plugins/enhance/lib/perf/baseline-comparator.js +50 -0
- package/plugins/enhance/lib/perf/baseline-store.js +127 -0
- package/plugins/enhance/lib/perf/benchmark-runner.js +399 -0
- package/plugins/enhance/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/enhance/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/enhance/lib/perf/checkpoint.js +123 -0
- package/plugins/enhance/lib/perf/code-paths.js +86 -0
- package/plugins/enhance/lib/perf/consolidation.js +37 -0
- package/plugins/enhance/lib/perf/constraint-runner.js +71 -0
- package/plugins/enhance/lib/perf/experiment-runner.js +32 -0
- package/plugins/enhance/lib/perf/index.js +41 -0
- package/plugins/enhance/lib/perf/investigation-state.js +875 -0
- package/plugins/enhance/lib/perf/optimization-runner.js +79 -0
- package/plugins/enhance/lib/perf/profilers/go.js +22 -0
- package/plugins/enhance/lib/perf/profilers/index.js +46 -0
- package/plugins/enhance/lib/perf/profilers/java.js +23 -0
- package/plugins/enhance/lib/perf/profilers/node.js +27 -0
- package/plugins/enhance/lib/perf/profilers/python.js +23 -0
- package/plugins/enhance/lib/perf/profilers/rust.js +23 -0
- package/plugins/enhance/lib/perf/profiling-runner.js +56 -0
- package/plugins/enhance/lib/perf/schemas.js +140 -0
- package/plugins/enhance/lib/platform/detect-platform.js +413 -0
- package/plugins/enhance/lib/platform/detection-configs.js +93 -0
- package/plugins/enhance/lib/platform/state-dir.js +132 -0
- package/plugins/enhance/lib/platform/verify-tools.js +182 -0
- package/plugins/enhance/lib/repo-map/cache.js +152 -0
- package/plugins/enhance/lib/repo-map/index.js +222 -0
- package/plugins/enhance/lib/repo-map/installer.js +212 -0
- package/plugins/enhance/lib/repo-map/queries/go.js +27 -0
- package/plugins/enhance/lib/repo-map/queries/index.js +100 -0
- package/plugins/enhance/lib/repo-map/queries/java.js +38 -0
- package/plugins/enhance/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/enhance/lib/repo-map/queries/python.js +24 -0
- package/plugins/enhance/lib/repo-map/queries/rust.js +73 -0
- package/plugins/enhance/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/enhance/lib/repo-map/runner.js +1165 -0
- package/plugins/enhance/lib/repo-map/updater.js +474 -0
- package/plugins/enhance/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/enhance/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/enhance/lib/schemas/validator.js +247 -0
- package/plugins/enhance/lib/sources/custom-handler.js +199 -0
- package/plugins/enhance/lib/sources/policy-questions.js +246 -0
- package/plugins/enhance/lib/sources/source-cache.js +165 -0
- package/plugins/enhance/lib/state/workflow-state.js +575 -0
- package/plugins/enhance/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/enhance/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/enhance/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/enhance/lib/types/index.d.ts +84 -0
- package/plugins/enhance/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/enhance/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/enhance/lib/utils/atomic-write.js +94 -0
- package/plugins/enhance/lib/utils/cache-manager.js +159 -0
- package/plugins/enhance/lib/utils/context-optimizer.js +300 -0
- package/plugins/enhance/lib/utils/deprecation.js +37 -0
- package/plugins/enhance/lib/utils/shell-escape.js +88 -0
- package/plugins/enhance/skills/enhance-agent-prompts/SKILL.md +277 -0
- package/plugins/enhance/skills/enhance-claude-memory/SKILL.md +387 -0
- package/plugins/enhance/skills/enhance-cross-file/SKILL.md +110 -0
- package/plugins/enhance/skills/enhance-docs/SKILL.md +298 -0
- package/plugins/enhance/skills/enhance-hooks/SKILL.md +554 -0
- package/plugins/enhance/skills/enhance-orchestrator/SKILL.md +255 -0
- package/plugins/enhance/skills/enhance-plugins/SKILL.md +319 -0
- package/plugins/enhance/skills/enhance-prompts/SKILL.md +340 -0
- package/plugins/enhance/skills/enhance-skills/SKILL.md +436 -0
- package/plugins/learn/.claude-plugin/plugin.json +21 -0
- package/plugins/learn/agents/learn-agent.md +331 -0
- package/plugins/learn/commands/learn.md +190 -0
- package/plugins/learn/lib/adapter-transforms.js +278 -0
- package/plugins/learn/lib/collectors/codebase.js +392 -0
- package/plugins/learn/lib/collectors/docs-patterns.js +713 -0
- package/plugins/learn/lib/collectors/documentation.js +219 -0
- package/plugins/learn/lib/collectors/github.js +266 -0
- package/plugins/learn/lib/collectors/index.js +126 -0
- package/plugins/learn/lib/config/index.js +14 -0
- package/plugins/learn/lib/cross-platform/index.js +539 -0
- package/plugins/learn/lib/discovery/index.js +352 -0
- package/plugins/learn/lib/drift-detect/collectors.js +37 -0
- package/plugins/learn/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/learn/lib/enhance/agent-patterns.js +571 -0
- package/plugins/learn/lib/enhance/auto-suppression.js +622 -0
- package/plugins/learn/lib/enhance/benchmark.js +417 -0
- package/plugins/learn/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/learn/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/learn/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/learn/lib/enhance/docs-patterns.js +671 -0
- package/plugins/learn/lib/enhance/fixer.js +721 -0
- package/plugins/learn/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/learn/lib/enhance/hook-patterns.js +40 -0
- package/plugins/learn/lib/enhance/index.js +127 -0
- package/plugins/learn/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/learn/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/learn/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/learn/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/learn/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/learn/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/learn/lib/enhance/reporter.js +1348 -0
- package/plugins/learn/lib/enhance/security-patterns.js +284 -0
- package/plugins/learn/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/learn/lib/enhance/skill-patterns.js +147 -0
- package/plugins/learn/lib/enhance/suppression.js +352 -0
- package/plugins/learn/lib/enhance/tool-patterns.js +373 -0
- package/plugins/learn/lib/index.js +270 -0
- package/plugins/learn/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/learn/lib/patterns/pipeline.js +948 -0
- package/plugins/learn/lib/patterns/review-patterns.js +558 -0
- package/plugins/learn/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/learn/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/learn/lib/perf/analyzer/index.js +22 -0
- package/plugins/learn/lib/perf/argument-parser.js +105 -0
- package/plugins/learn/lib/perf/baseline-comparator.js +50 -0
- package/plugins/learn/lib/perf/baseline-store.js +127 -0
- package/plugins/learn/lib/perf/benchmark-runner.js +399 -0
- package/plugins/learn/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/learn/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/learn/lib/perf/checkpoint.js +123 -0
- package/plugins/learn/lib/perf/code-paths.js +86 -0
- package/plugins/learn/lib/perf/consolidation.js +37 -0
- package/plugins/learn/lib/perf/constraint-runner.js +71 -0
- package/plugins/learn/lib/perf/experiment-runner.js +32 -0
- package/plugins/learn/lib/perf/index.js +41 -0
- package/plugins/learn/lib/perf/investigation-state.js +875 -0
- package/plugins/learn/lib/perf/optimization-runner.js +79 -0
- package/plugins/learn/lib/perf/profilers/go.js +22 -0
- package/plugins/learn/lib/perf/profilers/index.js +46 -0
- package/plugins/learn/lib/perf/profilers/java.js +23 -0
- package/plugins/learn/lib/perf/profilers/node.js +27 -0
- package/plugins/learn/lib/perf/profilers/python.js +23 -0
- package/plugins/learn/lib/perf/profilers/rust.js +23 -0
- package/plugins/learn/lib/perf/profiling-runner.js +56 -0
- package/plugins/learn/lib/perf/schemas.js +140 -0
- package/plugins/learn/lib/platform/detect-platform.js +413 -0
- package/plugins/learn/lib/platform/detection-configs.js +93 -0
- package/plugins/learn/lib/platform/state-dir.js +132 -0
- package/plugins/learn/lib/platform/verify-tools.js +182 -0
- package/plugins/learn/lib/repo-map/cache.js +152 -0
- package/plugins/learn/lib/repo-map/index.js +222 -0
- package/plugins/learn/lib/repo-map/installer.js +212 -0
- package/plugins/learn/lib/repo-map/queries/go.js +27 -0
- package/plugins/learn/lib/repo-map/queries/index.js +100 -0
- package/plugins/learn/lib/repo-map/queries/java.js +38 -0
- package/plugins/learn/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/learn/lib/repo-map/queries/python.js +24 -0
- package/plugins/learn/lib/repo-map/queries/rust.js +73 -0
- package/plugins/learn/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/learn/lib/repo-map/runner.js +1165 -0
- package/plugins/learn/lib/repo-map/updater.js +474 -0
- package/plugins/learn/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/learn/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/learn/lib/schemas/validator.js +247 -0
- package/plugins/learn/lib/sources/custom-handler.js +199 -0
- package/plugins/learn/lib/sources/policy-questions.js +246 -0
- package/plugins/learn/lib/sources/source-cache.js +165 -0
- package/plugins/learn/lib/state/workflow-state.js +575 -0
- package/plugins/learn/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/learn/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/learn/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/learn/lib/types/index.d.ts +84 -0
- package/plugins/learn/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/learn/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/learn/lib/utils/atomic-write.js +94 -0
- package/plugins/learn/lib/utils/cache-manager.js +159 -0
- package/plugins/learn/lib/utils/context-optimizer.js +300 -0
- package/plugins/learn/lib/utils/deprecation.js +37 -0
- package/plugins/learn/lib/utils/shell-escape.js +88 -0
- package/plugins/learn/skills/learn/SKILL.md +349 -0
- package/plugins/next-task/.claude-plugin/plugin.json +24 -0
- package/plugins/next-task/agents/ci-fixer.md +259 -0
- package/plugins/next-task/agents/ci-monitor.md +342 -0
- package/plugins/next-task/agents/delivery-validator.md +115 -0
- package/plugins/next-task/agents/exploration-agent.md +316 -0
- package/plugins/next-task/agents/implementation-agent.md +465 -0
- package/plugins/next-task/agents/planning-agent.md +377 -0
- package/plugins/next-task/agents/simple-fixer.md +139 -0
- package/plugins/next-task/agents/task-discoverer.md +89 -0
- package/plugins/next-task/agents/test-coverage-checker.md +451 -0
- package/plugins/next-task/agents/worktree-manager.md +257 -0
- package/plugins/next-task/commands/delivery-approval.md +341 -0
- package/plugins/next-task/commands/next-task.md +547 -0
- package/plugins/next-task/hooks/hooks.json +14 -0
- package/plugins/next-task/lib/adapter-transforms.js +278 -0
- package/plugins/next-task/lib/collectors/codebase.js +392 -0
- package/plugins/next-task/lib/collectors/docs-patterns.js +713 -0
- package/plugins/next-task/lib/collectors/documentation.js +219 -0
- package/plugins/next-task/lib/collectors/github.js +266 -0
- package/plugins/next-task/lib/collectors/index.js +126 -0
- package/plugins/next-task/lib/config/index.js +14 -0
- package/plugins/next-task/lib/cross-platform/index.js +539 -0
- package/plugins/next-task/lib/discovery/index.js +352 -0
- package/plugins/next-task/lib/drift-detect/collectors.js +37 -0
- package/plugins/next-task/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/next-task/lib/enhance/agent-patterns.js +571 -0
- package/plugins/next-task/lib/enhance/auto-suppression.js +622 -0
- package/plugins/next-task/lib/enhance/benchmark.js +417 -0
- package/plugins/next-task/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/next-task/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/next-task/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/next-task/lib/enhance/docs-patterns.js +671 -0
- package/plugins/next-task/lib/enhance/fixer.js +721 -0
- package/plugins/next-task/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/next-task/lib/enhance/hook-patterns.js +40 -0
- package/plugins/next-task/lib/enhance/index.js +127 -0
- package/plugins/next-task/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/next-task/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/next-task/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/next-task/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/next-task/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/next-task/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/next-task/lib/enhance/reporter.js +1348 -0
- package/plugins/next-task/lib/enhance/security-patterns.js +284 -0
- package/plugins/next-task/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/next-task/lib/enhance/skill-patterns.js +147 -0
- package/plugins/next-task/lib/enhance/suppression.js +352 -0
- package/plugins/next-task/lib/enhance/tool-patterns.js +373 -0
- package/plugins/next-task/lib/index.js +270 -0
- package/plugins/next-task/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/next-task/lib/patterns/pipeline.js +948 -0
- package/plugins/next-task/lib/patterns/review-patterns.js +558 -0
- package/plugins/next-task/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/next-task/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/next-task/lib/perf/analyzer/index.js +22 -0
- package/plugins/next-task/lib/perf/argument-parser.js +105 -0
- package/plugins/next-task/lib/perf/baseline-comparator.js +50 -0
- package/plugins/next-task/lib/perf/baseline-store.js +127 -0
- package/plugins/next-task/lib/perf/benchmark-runner.js +399 -0
- package/plugins/next-task/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/next-task/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/next-task/lib/perf/checkpoint.js +123 -0
- package/plugins/next-task/lib/perf/code-paths.js +86 -0
- package/plugins/next-task/lib/perf/consolidation.js +37 -0
- package/plugins/next-task/lib/perf/constraint-runner.js +71 -0
- package/plugins/next-task/lib/perf/experiment-runner.js +32 -0
- package/plugins/next-task/lib/perf/index.js +41 -0
- package/plugins/next-task/lib/perf/investigation-state.js +875 -0
- package/plugins/next-task/lib/perf/optimization-runner.js +79 -0
- package/plugins/next-task/lib/perf/profilers/go.js +22 -0
- package/plugins/next-task/lib/perf/profilers/index.js +46 -0
- package/plugins/next-task/lib/perf/profilers/java.js +23 -0
- package/plugins/next-task/lib/perf/profilers/node.js +27 -0
- package/plugins/next-task/lib/perf/profilers/python.js +23 -0
- package/plugins/next-task/lib/perf/profilers/rust.js +23 -0
- package/plugins/next-task/lib/perf/profiling-runner.js +56 -0
- package/plugins/next-task/lib/perf/schemas.js +140 -0
- package/plugins/next-task/lib/platform/detect-platform.js +413 -0
- package/plugins/next-task/lib/platform/detection-configs.js +93 -0
- package/plugins/next-task/lib/platform/state-dir.js +132 -0
- package/plugins/next-task/lib/platform/verify-tools.js +182 -0
- package/plugins/next-task/lib/repo-map/cache.js +152 -0
- package/plugins/next-task/lib/repo-map/index.js +222 -0
- package/plugins/next-task/lib/repo-map/installer.js +212 -0
- package/plugins/next-task/lib/repo-map/queries/go.js +27 -0
- package/plugins/next-task/lib/repo-map/queries/index.js +100 -0
- package/plugins/next-task/lib/repo-map/queries/java.js +38 -0
- package/plugins/next-task/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/next-task/lib/repo-map/queries/python.js +24 -0
- package/plugins/next-task/lib/repo-map/queries/rust.js +73 -0
- package/plugins/next-task/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/next-task/lib/repo-map/runner.js +1165 -0
- package/plugins/next-task/lib/repo-map/updater.js +474 -0
- package/plugins/next-task/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/next-task/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/next-task/lib/schemas/validator.js +247 -0
- package/plugins/next-task/lib/sources/custom-handler.js +199 -0
- package/plugins/next-task/lib/sources/policy-questions.js +246 -0
- package/plugins/next-task/lib/sources/source-cache.js +165 -0
- package/plugins/next-task/lib/state/workflow-state.js +575 -0
- package/plugins/next-task/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/next-task/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/next-task/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/next-task/lib/types/index.d.ts +84 -0
- package/plugins/next-task/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/next-task/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/next-task/lib/utils/atomic-write.js +94 -0
- package/plugins/next-task/lib/utils/cache-manager.js +159 -0
- package/plugins/next-task/lib/utils/context-optimizer.js +300 -0
- package/plugins/next-task/lib/utils/deprecation.js +37 -0
- package/plugins/next-task/lib/utils/shell-escape.js +88 -0
- package/plugins/next-task/skills/discover-tasks/SKILL.md +191 -0
- package/plugins/next-task/skills/orchestrate-review/SKILL.md +239 -0
- package/plugins/next-task/skills/validate-delivery/SKILL.md +186 -0
- package/plugins/perf/.claude-plugin/plugin.json +20 -0
- package/plugins/perf/agents/perf-analyzer.md +43 -0
- package/plugins/perf/agents/perf-code-paths.md +16 -0
- package/plugins/perf/agents/perf-investigation-logger.md +47 -0
- package/plugins/perf/agents/perf-orchestrator.md +344 -0
- package/plugins/perf/agents/perf-theory-gatherer.md +25 -0
- package/plugins/perf/agents/perf-theory-tester.md +58 -0
- package/plugins/perf/commands/perf.md +470 -0
- package/plugins/perf/hooks/checkpoint.md +35 -0
- package/plugins/perf/hooks/constraint-tester.md +40 -0
- package/plugins/perf/lib/adapter-transforms.js +278 -0
- package/plugins/perf/lib/collectors/codebase.js +392 -0
- package/plugins/perf/lib/collectors/docs-patterns.js +713 -0
- package/plugins/perf/lib/collectors/documentation.js +219 -0
- package/plugins/perf/lib/collectors/github.js +266 -0
- package/plugins/perf/lib/collectors/index.js +126 -0
- package/plugins/perf/lib/config/index.js +14 -0
- package/plugins/perf/lib/cross-platform/index.js +539 -0
- package/plugins/perf/lib/discovery/index.js +352 -0
- package/plugins/perf/lib/drift-detect/collectors.js +37 -0
- package/plugins/perf/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/perf/lib/enhance/agent-patterns.js +571 -0
- package/plugins/perf/lib/enhance/auto-suppression.js +622 -0
- package/plugins/perf/lib/enhance/benchmark.js +417 -0
- package/plugins/perf/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/perf/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/perf/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/perf/lib/enhance/docs-patterns.js +671 -0
- package/plugins/perf/lib/enhance/fixer.js +721 -0
- package/plugins/perf/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/perf/lib/enhance/hook-patterns.js +40 -0
- package/plugins/perf/lib/enhance/index.js +127 -0
- package/plugins/perf/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/perf/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/perf/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/perf/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/perf/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/perf/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/perf/lib/enhance/reporter.js +1348 -0
- package/plugins/perf/lib/enhance/security-patterns.js +284 -0
- package/plugins/perf/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/perf/lib/enhance/skill-patterns.js +147 -0
- package/plugins/perf/lib/enhance/suppression.js +352 -0
- package/plugins/perf/lib/enhance/tool-patterns.js +373 -0
- package/plugins/perf/lib/index.js +270 -0
- package/plugins/perf/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/perf/lib/patterns/pipeline.js +948 -0
- package/plugins/perf/lib/patterns/review-patterns.js +558 -0
- package/plugins/perf/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/perf/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/perf/lib/perf/analyzer/index.js +22 -0
- package/plugins/perf/lib/perf/argument-parser.js +105 -0
- package/plugins/perf/lib/perf/baseline-comparator.js +50 -0
- package/plugins/perf/lib/perf/baseline-store.js +127 -0
- package/plugins/perf/lib/perf/benchmark-runner.js +399 -0
- package/plugins/perf/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/perf/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/perf/lib/perf/checkpoint.js +123 -0
- package/plugins/perf/lib/perf/code-paths.js +86 -0
- package/plugins/perf/lib/perf/consolidation.js +37 -0
- package/plugins/perf/lib/perf/constraint-runner.js +71 -0
- package/plugins/perf/lib/perf/experiment-runner.js +32 -0
- package/plugins/perf/lib/perf/index.js +41 -0
- package/plugins/perf/lib/perf/investigation-state.js +875 -0
- package/plugins/perf/lib/perf/optimization-runner.js +79 -0
- package/plugins/perf/lib/perf/profilers/go.js +22 -0
- package/plugins/perf/lib/perf/profilers/index.js +46 -0
- package/plugins/perf/lib/perf/profilers/java.js +23 -0
- package/plugins/perf/lib/perf/profilers/node.js +27 -0
- package/plugins/perf/lib/perf/profilers/python.js +23 -0
- package/plugins/perf/lib/perf/profilers/rust.js +23 -0
- package/plugins/perf/lib/perf/profiling-runner.js +56 -0
- package/plugins/perf/lib/perf/schemas.js +140 -0
- package/plugins/perf/lib/platform/detect-platform.js +413 -0
- package/plugins/perf/lib/platform/detection-configs.js +93 -0
- package/plugins/perf/lib/platform/state-dir.js +132 -0
- package/plugins/perf/lib/platform/verify-tools.js +182 -0
- package/plugins/perf/lib/repo-map/cache.js +152 -0
- package/plugins/perf/lib/repo-map/index.js +222 -0
- package/plugins/perf/lib/repo-map/installer.js +212 -0
- package/plugins/perf/lib/repo-map/queries/go.js +27 -0
- package/plugins/perf/lib/repo-map/queries/index.js +100 -0
- package/plugins/perf/lib/repo-map/queries/java.js +38 -0
- package/plugins/perf/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/perf/lib/repo-map/queries/python.js +24 -0
- package/plugins/perf/lib/repo-map/queries/rust.js +73 -0
- package/plugins/perf/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/perf/lib/repo-map/runner.js +1165 -0
- package/plugins/perf/lib/repo-map/updater.js +474 -0
- package/plugins/perf/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/perf/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/perf/lib/schemas/validator.js +247 -0
- package/plugins/perf/lib/sources/custom-handler.js +199 -0
- package/plugins/perf/lib/sources/policy-questions.js +246 -0
- package/plugins/perf/lib/sources/source-cache.js +165 -0
- package/plugins/perf/lib/state/workflow-state.js +575 -0
- package/plugins/perf/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/perf/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/perf/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/perf/lib/types/index.d.ts +84 -0
- package/plugins/perf/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/perf/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/perf/lib/utils/atomic-write.js +94 -0
- package/plugins/perf/lib/utils/cache-manager.js +159 -0
- package/plugins/perf/lib/utils/context-optimizer.js +300 -0
- package/plugins/perf/lib/utils/deprecation.js +37 -0
- package/plugins/perf/lib/utils/shell-escape.js +88 -0
- package/plugins/perf/skills/perf-analyzer/SKILL.md +37 -0
- package/plugins/perf/skills/perf-baseline-manager/SKILL.md +30 -0
- package/plugins/perf/skills/perf-benchmarker/SKILL.md +52 -0
- package/plugins/perf/skills/perf-code-paths/SKILL.md +32 -0
- package/plugins/perf/skills/perf-investigation-logger/SKILL.md +41 -0
- package/plugins/perf/skills/perf-profiler/SKILL.md +42 -0
- package/plugins/perf/skills/perf-theory-gatherer/SKILL.md +35 -0
- package/plugins/perf/skills/perf-theory-tester/SKILL.md +36 -0
- package/plugins/repo-map/.claude-plugin/plugin.json +22 -0
- package/plugins/repo-map/agents/map-validator.md +60 -0
- package/plugins/repo-map/commands/repo-map.md +133 -0
- package/plugins/repo-map/lib/adapter-transforms.js +278 -0
- package/plugins/repo-map/lib/collectors/codebase.js +392 -0
- package/plugins/repo-map/lib/collectors/docs-patterns.js +713 -0
- package/plugins/repo-map/lib/collectors/documentation.js +219 -0
- package/plugins/repo-map/lib/collectors/github.js +266 -0
- package/plugins/repo-map/lib/collectors/index.js +126 -0
- package/plugins/repo-map/lib/config/index.js +14 -0
- package/plugins/repo-map/lib/cross-platform/index.js +539 -0
- package/plugins/repo-map/lib/discovery/index.js +352 -0
- package/plugins/repo-map/lib/drift-detect/collectors.js +37 -0
- package/plugins/repo-map/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/repo-map/lib/enhance/agent-patterns.js +571 -0
- package/plugins/repo-map/lib/enhance/auto-suppression.js +622 -0
- package/plugins/repo-map/lib/enhance/benchmark.js +417 -0
- package/plugins/repo-map/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/repo-map/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/repo-map/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/repo-map/lib/enhance/docs-patterns.js +671 -0
- package/plugins/repo-map/lib/enhance/fixer.js +721 -0
- package/plugins/repo-map/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/repo-map/lib/enhance/hook-patterns.js +40 -0
- package/plugins/repo-map/lib/enhance/index.js +127 -0
- package/plugins/repo-map/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/repo-map/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/repo-map/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/repo-map/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/repo-map/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/repo-map/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/repo-map/lib/enhance/reporter.js +1348 -0
- package/plugins/repo-map/lib/enhance/security-patterns.js +284 -0
- package/plugins/repo-map/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/repo-map/lib/enhance/skill-patterns.js +147 -0
- package/plugins/repo-map/lib/enhance/suppression.js +352 -0
- package/plugins/repo-map/lib/enhance/tool-patterns.js +373 -0
- package/plugins/repo-map/lib/index.js +270 -0
- package/plugins/repo-map/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/repo-map/lib/patterns/pipeline.js +948 -0
- package/plugins/repo-map/lib/patterns/review-patterns.js +558 -0
- package/plugins/repo-map/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/repo-map/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/repo-map/lib/perf/analyzer/index.js +22 -0
- package/plugins/repo-map/lib/perf/argument-parser.js +105 -0
- package/plugins/repo-map/lib/perf/baseline-comparator.js +50 -0
- package/plugins/repo-map/lib/perf/baseline-store.js +127 -0
- package/plugins/repo-map/lib/perf/benchmark-runner.js +399 -0
- package/plugins/repo-map/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/repo-map/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/repo-map/lib/perf/checkpoint.js +123 -0
- package/plugins/repo-map/lib/perf/code-paths.js +86 -0
- package/plugins/repo-map/lib/perf/consolidation.js +37 -0
- package/plugins/repo-map/lib/perf/constraint-runner.js +71 -0
- package/plugins/repo-map/lib/perf/experiment-runner.js +32 -0
- package/plugins/repo-map/lib/perf/index.js +41 -0
- package/plugins/repo-map/lib/perf/investigation-state.js +875 -0
- package/plugins/repo-map/lib/perf/optimization-runner.js +79 -0
- package/plugins/repo-map/lib/perf/profilers/go.js +22 -0
- package/plugins/repo-map/lib/perf/profilers/index.js +46 -0
- package/plugins/repo-map/lib/perf/profilers/java.js +23 -0
- package/plugins/repo-map/lib/perf/profilers/node.js +27 -0
- package/plugins/repo-map/lib/perf/profilers/python.js +23 -0
- package/plugins/repo-map/lib/perf/profilers/rust.js +23 -0
- package/plugins/repo-map/lib/perf/profiling-runner.js +56 -0
- package/plugins/repo-map/lib/perf/schemas.js +140 -0
- package/plugins/repo-map/lib/platform/detect-platform.js +413 -0
- package/plugins/repo-map/lib/platform/detection-configs.js +93 -0
- package/plugins/repo-map/lib/platform/state-dir.js +132 -0
- package/plugins/repo-map/lib/platform/verify-tools.js +182 -0
- package/plugins/repo-map/lib/repo-map/cache.js +152 -0
- package/plugins/repo-map/lib/repo-map/index.js +222 -0
- package/plugins/repo-map/lib/repo-map/installer.js +212 -0
- package/plugins/repo-map/lib/repo-map/queries/go.js +27 -0
- package/plugins/repo-map/lib/repo-map/queries/index.js +100 -0
- package/plugins/repo-map/lib/repo-map/queries/java.js +38 -0
- package/plugins/repo-map/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/repo-map/lib/repo-map/queries/python.js +24 -0
- package/plugins/repo-map/lib/repo-map/queries/rust.js +73 -0
- package/plugins/repo-map/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/repo-map/lib/repo-map/runner.js +1165 -0
- package/plugins/repo-map/lib/repo-map/updater.js +474 -0
- package/plugins/repo-map/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/repo-map/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/repo-map/lib/schemas/validator.js +247 -0
- package/plugins/repo-map/lib/sources/custom-handler.js +199 -0
- package/plugins/repo-map/lib/sources/policy-questions.js +246 -0
- package/plugins/repo-map/lib/sources/source-cache.js +165 -0
- package/plugins/repo-map/lib/state/workflow-state.js +575 -0
- package/plugins/repo-map/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/repo-map/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/repo-map/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/repo-map/lib/types/index.d.ts +84 -0
- package/plugins/repo-map/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/repo-map/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/repo-map/lib/utils/atomic-write.js +94 -0
- package/plugins/repo-map/lib/utils/cache-manager.js +159 -0
- package/plugins/repo-map/lib/utils/context-optimizer.js +300 -0
- package/plugins/repo-map/lib/utils/deprecation.js +37 -0
- package/plugins/repo-map/lib/utils/shell-escape.js +88 -0
- package/plugins/repo-map/skills/repo-mapping/SKILL.md +83 -0
- package/plugins/ship/.claude-plugin/plugin.json +21 -0
- package/plugins/ship/commands/ship-ci-review-loop.md +472 -0
- package/plugins/ship/commands/ship-deployment.md +335 -0
- package/plugins/ship/commands/ship-error-handling.md +258 -0
- package/plugins/ship/commands/ship.md +492 -0
- package/plugins/ship/lib/adapter-transforms.js +278 -0
- package/plugins/ship/lib/collectors/codebase.js +392 -0
- package/plugins/ship/lib/collectors/docs-patterns.js +713 -0
- package/plugins/ship/lib/collectors/documentation.js +219 -0
- package/plugins/ship/lib/collectors/github.js +266 -0
- package/plugins/ship/lib/collectors/index.js +126 -0
- package/plugins/ship/lib/config/index.js +14 -0
- package/plugins/ship/lib/cross-platform/index.js +539 -0
- package/plugins/ship/lib/discovery/index.js +352 -0
- package/plugins/ship/lib/drift-detect/collectors.js +37 -0
- package/plugins/ship/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/ship/lib/enhance/agent-patterns.js +571 -0
- package/plugins/ship/lib/enhance/auto-suppression.js +622 -0
- package/plugins/ship/lib/enhance/benchmark.js +417 -0
- package/plugins/ship/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/ship/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/ship/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/ship/lib/enhance/docs-patterns.js +671 -0
- package/plugins/ship/lib/enhance/fixer.js +721 -0
- package/plugins/ship/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/ship/lib/enhance/hook-patterns.js +40 -0
- package/plugins/ship/lib/enhance/index.js +127 -0
- package/plugins/ship/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/ship/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/ship/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/ship/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/ship/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/ship/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/ship/lib/enhance/reporter.js +1348 -0
- package/plugins/ship/lib/enhance/security-patterns.js +284 -0
- package/plugins/ship/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/ship/lib/enhance/skill-patterns.js +147 -0
- package/plugins/ship/lib/enhance/suppression.js +352 -0
- package/plugins/ship/lib/enhance/tool-patterns.js +373 -0
- package/plugins/ship/lib/index.js +270 -0
- package/plugins/ship/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/ship/lib/patterns/pipeline.js +948 -0
- package/plugins/ship/lib/patterns/review-patterns.js +558 -0
- package/plugins/ship/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/ship/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/ship/lib/perf/analyzer/index.js +22 -0
- package/plugins/ship/lib/perf/argument-parser.js +105 -0
- package/plugins/ship/lib/perf/baseline-comparator.js +50 -0
- package/plugins/ship/lib/perf/baseline-store.js +127 -0
- package/plugins/ship/lib/perf/benchmark-runner.js +399 -0
- package/plugins/ship/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/ship/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/ship/lib/perf/checkpoint.js +123 -0
- package/plugins/ship/lib/perf/code-paths.js +86 -0
- package/plugins/ship/lib/perf/consolidation.js +37 -0
- package/plugins/ship/lib/perf/constraint-runner.js +71 -0
- package/plugins/ship/lib/perf/experiment-runner.js +32 -0
- package/plugins/ship/lib/perf/index.js +41 -0
- package/plugins/ship/lib/perf/investigation-state.js +875 -0
- package/plugins/ship/lib/perf/optimization-runner.js +79 -0
- package/plugins/ship/lib/perf/profilers/go.js +22 -0
- package/plugins/ship/lib/perf/profilers/index.js +46 -0
- package/plugins/ship/lib/perf/profilers/java.js +23 -0
- package/plugins/ship/lib/perf/profilers/node.js +27 -0
- package/plugins/ship/lib/perf/profilers/python.js +23 -0
- package/plugins/ship/lib/perf/profilers/rust.js +23 -0
- package/plugins/ship/lib/perf/profiling-runner.js +56 -0
- package/plugins/ship/lib/perf/schemas.js +140 -0
- package/plugins/ship/lib/platform/detect-platform.js +413 -0
- package/plugins/ship/lib/platform/detection-configs.js +93 -0
- package/plugins/ship/lib/platform/state-dir.js +132 -0
- package/plugins/ship/lib/platform/verify-tools.js +182 -0
- package/plugins/ship/lib/repo-map/cache.js +152 -0
- package/plugins/ship/lib/repo-map/index.js +222 -0
- package/plugins/ship/lib/repo-map/installer.js +212 -0
- package/plugins/ship/lib/repo-map/queries/go.js +27 -0
- package/plugins/ship/lib/repo-map/queries/index.js +100 -0
- package/plugins/ship/lib/repo-map/queries/java.js +38 -0
- package/plugins/ship/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/ship/lib/repo-map/queries/python.js +24 -0
- package/plugins/ship/lib/repo-map/queries/rust.js +73 -0
- package/plugins/ship/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/ship/lib/repo-map/runner.js +1165 -0
- package/plugins/ship/lib/repo-map/updater.js +474 -0
- package/plugins/ship/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/ship/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/ship/lib/schemas/validator.js +247 -0
- package/plugins/ship/lib/sources/custom-handler.js +199 -0
- package/plugins/ship/lib/sources/policy-questions.js +246 -0
- package/plugins/ship/lib/sources/source-cache.js +165 -0
- package/plugins/ship/lib/state/workflow-state.js +575 -0
- package/plugins/ship/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/ship/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/ship/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/ship/lib/types/index.d.ts +84 -0
- package/plugins/ship/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/ship/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/ship/lib/utils/atomic-write.js +94 -0
- package/plugins/ship/lib/utils/cache-manager.js +159 -0
- package/plugins/ship/lib/utils/context-optimizer.js +300 -0
- package/plugins/ship/lib/utils/deprecation.js +37 -0
- package/plugins/ship/lib/utils/shell-escape.js +88 -0
- package/plugins/sync-docs/.claude-plugin/plugin.json +20 -0
- package/plugins/sync-docs/agents/sync-docs-agent.md +154 -0
- package/plugins/sync-docs/commands/sync-docs.md +186 -0
- package/plugins/sync-docs/lib/adapter-transforms.js +278 -0
- package/plugins/sync-docs/lib/collectors/codebase.js +392 -0
- package/plugins/sync-docs/lib/collectors/docs-patterns.js +713 -0
- package/plugins/sync-docs/lib/collectors/documentation.js +219 -0
- package/plugins/sync-docs/lib/collectors/github.js +266 -0
- package/plugins/sync-docs/lib/collectors/index.js +126 -0
- package/plugins/sync-docs/lib/config/index.js +14 -0
- package/plugins/sync-docs/lib/cross-platform/index.js +539 -0
- package/plugins/sync-docs/lib/discovery/index.js +352 -0
- package/plugins/sync-docs/lib/drift-detect/collectors.js +37 -0
- package/plugins/sync-docs/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/sync-docs/lib/enhance/agent-patterns.js +571 -0
- package/plugins/sync-docs/lib/enhance/auto-suppression.js +622 -0
- package/plugins/sync-docs/lib/enhance/benchmark.js +417 -0
- package/plugins/sync-docs/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/sync-docs/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/sync-docs/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/sync-docs/lib/enhance/docs-patterns.js +671 -0
- package/plugins/sync-docs/lib/enhance/fixer.js +721 -0
- package/plugins/sync-docs/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/sync-docs/lib/enhance/hook-patterns.js +40 -0
- package/plugins/sync-docs/lib/enhance/index.js +127 -0
- package/plugins/sync-docs/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/sync-docs/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/sync-docs/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/sync-docs/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/sync-docs/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/sync-docs/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/sync-docs/lib/enhance/reporter.js +1348 -0
- package/plugins/sync-docs/lib/enhance/security-patterns.js +284 -0
- package/plugins/sync-docs/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/sync-docs/lib/enhance/skill-patterns.js +147 -0
- package/plugins/sync-docs/lib/enhance/suppression.js +352 -0
- package/plugins/sync-docs/lib/enhance/tool-patterns.js +373 -0
- package/plugins/sync-docs/lib/index.js +270 -0
- package/plugins/sync-docs/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/sync-docs/lib/patterns/pipeline.js +948 -0
- package/plugins/sync-docs/lib/patterns/review-patterns.js +558 -0
- package/plugins/sync-docs/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/sync-docs/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/sync-docs/lib/perf/analyzer/index.js +22 -0
- package/plugins/sync-docs/lib/perf/argument-parser.js +105 -0
- package/plugins/sync-docs/lib/perf/baseline-comparator.js +50 -0
- package/plugins/sync-docs/lib/perf/baseline-store.js +127 -0
- package/plugins/sync-docs/lib/perf/benchmark-runner.js +399 -0
- package/plugins/sync-docs/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/sync-docs/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/sync-docs/lib/perf/checkpoint.js +123 -0
- package/plugins/sync-docs/lib/perf/code-paths.js +86 -0
- package/plugins/sync-docs/lib/perf/consolidation.js +37 -0
- package/plugins/sync-docs/lib/perf/constraint-runner.js +71 -0
- package/plugins/sync-docs/lib/perf/experiment-runner.js +32 -0
- package/plugins/sync-docs/lib/perf/index.js +41 -0
- package/plugins/sync-docs/lib/perf/investigation-state.js +875 -0
- package/plugins/sync-docs/lib/perf/optimization-runner.js +79 -0
- package/plugins/sync-docs/lib/perf/profilers/go.js +22 -0
- package/plugins/sync-docs/lib/perf/profilers/index.js +46 -0
- package/plugins/sync-docs/lib/perf/profilers/java.js +23 -0
- package/plugins/sync-docs/lib/perf/profilers/node.js +27 -0
- package/plugins/sync-docs/lib/perf/profilers/python.js +23 -0
- package/plugins/sync-docs/lib/perf/profilers/rust.js +23 -0
- package/plugins/sync-docs/lib/perf/profiling-runner.js +56 -0
- package/plugins/sync-docs/lib/perf/schemas.js +140 -0
- package/plugins/sync-docs/lib/platform/detect-platform.js +413 -0
- package/plugins/sync-docs/lib/platform/detection-configs.js +93 -0
- package/plugins/sync-docs/lib/platform/state-dir.js +132 -0
- package/plugins/sync-docs/lib/platform/verify-tools.js +182 -0
- package/plugins/sync-docs/lib/repo-map/cache.js +152 -0
- package/plugins/sync-docs/lib/repo-map/index.js +222 -0
- package/plugins/sync-docs/lib/repo-map/installer.js +212 -0
- package/plugins/sync-docs/lib/repo-map/queries/go.js +27 -0
- package/plugins/sync-docs/lib/repo-map/queries/index.js +100 -0
- package/plugins/sync-docs/lib/repo-map/queries/java.js +38 -0
- package/plugins/sync-docs/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/sync-docs/lib/repo-map/queries/python.js +24 -0
- package/plugins/sync-docs/lib/repo-map/queries/rust.js +73 -0
- package/plugins/sync-docs/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/sync-docs/lib/repo-map/runner.js +1165 -0
- package/plugins/sync-docs/lib/repo-map/updater.js +474 -0
- package/plugins/sync-docs/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/sync-docs/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/sync-docs/lib/schemas/validator.js +247 -0
- package/plugins/sync-docs/lib/sources/custom-handler.js +199 -0
- package/plugins/sync-docs/lib/sources/policy-questions.js +246 -0
- package/plugins/sync-docs/lib/sources/source-cache.js +165 -0
- package/plugins/sync-docs/lib/state/workflow-state.js +575 -0
- package/plugins/sync-docs/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/sync-docs/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/sync-docs/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/sync-docs/lib/types/index.d.ts +84 -0
- package/plugins/sync-docs/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/sync-docs/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/sync-docs/lib/utils/atomic-write.js +94 -0
- package/plugins/sync-docs/lib/utils/cache-manager.js +159 -0
- package/plugins/sync-docs/lib/utils/context-optimizer.js +300 -0
- package/plugins/sync-docs/lib/utils/deprecation.js +37 -0
- package/plugins/sync-docs/lib/utils/shell-escape.js +88 -0
- package/plugins/sync-docs/skills/sync-docs/SKILL.md +351 -0
- package/scripts/bump-version.js +92 -0
- package/scripts/check-hardcoded-paths.js +199 -0
- package/scripts/dev-install.js +493 -0
- package/scripts/expand-templates.js +269 -0
- package/scripts/gen-adapters.js +323 -0
- package/scripts/generate-docs.js +558 -0
- package/scripts/generate-plugin-list.js +20 -0
- package/scripts/migrate-opencode.js +307 -0
- package/scripts/perf/repo-map-create.js +46 -0
- package/scripts/plugins.txt +12 -0
- package/scripts/preflight.js +1263 -0
- package/scripts/scaffold.js +490 -0
- package/scripts/setup-hooks.js +169 -0
- package/scripts/stamp-version.js +175 -0
- package/scripts/test-transform.js +85 -0
- package/scripts/validate-agent-skill-compliance.js +284 -0
- package/scripts/validate-counts.js +457 -0
- package/scripts/validate-cross-platform-docs.js +550 -0
- package/scripts/validate-opencode-install.js +182 -0
- package/site/assets/css/main.css +1525 -0
- package/site/assets/css/tokens.css +493 -0
- package/site/assets/favicon.svg +23 -0
- package/site/assets/js/main.js +801 -0
- package/site/assets/logo.png +0 -0
- package/site/assets/og-image.html +163 -0
- package/site/content.json +453 -0
- package/site/index.html +698 -0
- package/site/ux-spec.md +683 -0
- package/site/version.json +5 -0
- package/templates/agent-snippets/enhance-integration-points.md +6 -0
- package/templates/agent-snippets/enhance-skill-delegation.md +18 -0
- package/templates/agent-snippets/model-choice.md +6 -0
|
@@ -0,0 +1,875 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performance investigation state management
|
|
3
|
+
*
|
|
4
|
+
* Stores investigation state and logs under the platform-aware state directory:
|
|
5
|
+
* - {state-dir}/perf/investigation.json
|
|
6
|
+
* - {state-dir}/perf/investigations/{id}.md
|
|
7
|
+
*
|
|
8
|
+
* @module lib/perf/investigation-state
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const crypto = require('crypto');
|
|
14
|
+
const { getStateDir } = require('../platform/state-dir');
|
|
15
|
+
const { validateInvestigationState, assertValid } = require('./schemas');
|
|
16
|
+
const { writeJsonAtomic, writeFileAtomic } = require('../utils/atomic-write');
|
|
17
|
+
|
|
18
|
+
const SCHEMA_VERSION = 1;
|
|
19
|
+
const INVESTIGATION_FILE = 'investigation.json';
|
|
20
|
+
const LOG_DIR = 'investigations';
|
|
21
|
+
const BASELINE_DIR = 'baselines';
|
|
22
|
+
|
|
23
|
+
const PHASES = [
|
|
24
|
+
'setup',
|
|
25
|
+
'baseline',
|
|
26
|
+
'breaking-point',
|
|
27
|
+
'constraints',
|
|
28
|
+
'hypotheses',
|
|
29
|
+
'code-paths',
|
|
30
|
+
'profiling',
|
|
31
|
+
'optimization',
|
|
32
|
+
'decision',
|
|
33
|
+
'consolidation'
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Validate and resolve path to prevent path traversal attacks
|
|
38
|
+
* @param {string} basePath - Base directory path
|
|
39
|
+
* @returns {string} Validated absolute path
|
|
40
|
+
*/
|
|
41
|
+
function validatePath(basePath) {
|
|
42
|
+
if (typeof basePath !== 'string' || basePath.length === 0) {
|
|
43
|
+
throw new Error('Path must be a non-empty string');
|
|
44
|
+
}
|
|
45
|
+
const resolved = path.resolve(basePath);
|
|
46
|
+
if (resolved.includes('\0')) {
|
|
47
|
+
throw new Error('Path contains invalid null byte');
|
|
48
|
+
}
|
|
49
|
+
return resolved;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Validate that target path is within base directory
|
|
54
|
+
* @param {string} targetPath - Target file path
|
|
55
|
+
* @param {string} basePath - Base directory
|
|
56
|
+
*/
|
|
57
|
+
function validatePathWithinBase(targetPath, basePath) {
|
|
58
|
+
const resolvedTarget = path.resolve(targetPath);
|
|
59
|
+
const resolvedBase = path.resolve(basePath);
|
|
60
|
+
if (!resolvedTarget.startsWith(resolvedBase + path.sep) && resolvedTarget !== resolvedBase) {
|
|
61
|
+
throw new Error('Path traversal detected');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function assertSafeInvestigationId(id) {
|
|
66
|
+
if (!id || typeof id !== 'string') {
|
|
67
|
+
throw new Error('Investigation id is required');
|
|
68
|
+
}
|
|
69
|
+
if (id.includes('..') || id.includes('/') || id.includes('\\') || id.includes('\0')) {
|
|
70
|
+
throw new Error('Investigation id contains invalid characters');
|
|
71
|
+
}
|
|
72
|
+
if (!/^[a-zA-Z0-9._-]+$/.test(id)) {
|
|
73
|
+
throw new Error('Investigation id contains invalid characters');
|
|
74
|
+
}
|
|
75
|
+
return id;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Generate a unique investigation ID
|
|
80
|
+
* @returns {string}
|
|
81
|
+
*/
|
|
82
|
+
function generateInvestigationId() {
|
|
83
|
+
const now = new Date();
|
|
84
|
+
const date = now.toISOString().slice(0, 10).replace(/-/g, '');
|
|
85
|
+
const time = now.toISOString().slice(11, 19).replace(/:/g, '');
|
|
86
|
+
const random = crypto.randomBytes(4).toString('hex');
|
|
87
|
+
return `perf-${date}-${time}-${random}`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Get perf state directory path
|
|
92
|
+
* @param {string} basePath
|
|
93
|
+
* @returns {string}
|
|
94
|
+
*/
|
|
95
|
+
function getPerfDir(basePath = process.cwd()) {
|
|
96
|
+
const validatedBase = validatePath(basePath);
|
|
97
|
+
const perfDir = path.join(validatedBase, getStateDir(basePath), 'perf');
|
|
98
|
+
validatePathWithinBase(perfDir, validatedBase);
|
|
99
|
+
return perfDir;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Ensure perf directories exist
|
|
104
|
+
* @param {string} basePath
|
|
105
|
+
* @returns {{ perfDir: string, logDir: string, baselineDir: string }}
|
|
106
|
+
*/
|
|
107
|
+
function ensurePerfDirs(basePath = process.cwd()) {
|
|
108
|
+
const perfDir = getPerfDir(basePath);
|
|
109
|
+
const logDir = path.join(perfDir, LOG_DIR);
|
|
110
|
+
const baselineDir = path.join(perfDir, BASELINE_DIR);
|
|
111
|
+
|
|
112
|
+
if (!fs.existsSync(perfDir)) {
|
|
113
|
+
fs.mkdirSync(perfDir, { recursive: true });
|
|
114
|
+
}
|
|
115
|
+
if (!fs.existsSync(logDir)) {
|
|
116
|
+
fs.mkdirSync(logDir, { recursive: true });
|
|
117
|
+
}
|
|
118
|
+
if (!fs.existsSync(baselineDir)) {
|
|
119
|
+
fs.mkdirSync(baselineDir, { recursive: true });
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return { perfDir, logDir, baselineDir };
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Get path to investigation.json
|
|
127
|
+
* @param {string} basePath
|
|
128
|
+
* @returns {string}
|
|
129
|
+
*/
|
|
130
|
+
function getInvestigationPath(basePath = process.cwd()) {
|
|
131
|
+
const perfDir = getPerfDir(basePath);
|
|
132
|
+
return path.join(perfDir, INVESTIGATION_FILE);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Get path to investigation log
|
|
137
|
+
* @param {string} id
|
|
138
|
+
* @param {string} basePath
|
|
139
|
+
* @returns {string}
|
|
140
|
+
*/
|
|
141
|
+
function getInvestigationLogPath(id, basePath = process.cwd()) {
|
|
142
|
+
const safeId = assertSafeInvestigationId(id);
|
|
143
|
+
const { logDir } = ensurePerfDirs(basePath);
|
|
144
|
+
return path.join(logDir, `${safeId}.md`);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Read investigation.json
|
|
149
|
+
* @param {string} basePath
|
|
150
|
+
* @returns {object|null}
|
|
151
|
+
*/
|
|
152
|
+
function readInvestigation(basePath = process.cwd()) {
|
|
153
|
+
const investigationPath = getInvestigationPath(basePath);
|
|
154
|
+
if (!fs.existsSync(investigationPath)) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
try {
|
|
158
|
+
const parsed = JSON.parse(fs.readFileSync(investigationPath, 'utf8'));
|
|
159
|
+
const validation = validateInvestigationState(parsed);
|
|
160
|
+
if (!validation.ok) {
|
|
161
|
+
console.error(`[CRITICAL] Invalid investigation state at ${investigationPath}: ${validation.errors.join(', ')}`);
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
return parsed;
|
|
165
|
+
} catch (error) {
|
|
166
|
+
console.error(`[CRITICAL] Corrupted investigation.json at ${investigationPath}: ${error.message}`);
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Write investigation.json
|
|
173
|
+
* Increments version for optimistic locking
|
|
174
|
+
* @param {object} state
|
|
175
|
+
* @param {string} basePath
|
|
176
|
+
* @returns {boolean}
|
|
177
|
+
*/
|
|
178
|
+
function writeInvestigation(state, basePath = process.cwd()) {
|
|
179
|
+
ensurePerfDirs(basePath);
|
|
180
|
+
const investigationPath = getInvestigationPath(basePath);
|
|
181
|
+
const nextState = {
|
|
182
|
+
...state,
|
|
183
|
+
updatedAt: new Date().toISOString(),
|
|
184
|
+
_version: (state._version || 0) + 1
|
|
185
|
+
};
|
|
186
|
+
assertValid(validateInvestigationState(nextState), 'Invalid investigation state');
|
|
187
|
+
writeJsonAtomic(investigationPath, nextState);
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Update investigation.json with partial updates
|
|
193
|
+
* Uses optimistic locking with version check and retry
|
|
194
|
+
* @param {object} updates
|
|
195
|
+
* @param {string} basePath
|
|
196
|
+
* @returns {object|null}
|
|
197
|
+
*/
|
|
198
|
+
function updateInvestigation(updates, basePath = process.cwd()) {
|
|
199
|
+
const MAX_RETRIES = 3;
|
|
200
|
+
|
|
201
|
+
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
|
|
202
|
+
const current = readInvestigation(basePath) || {};
|
|
203
|
+
const initialVersion = current._version || 0;
|
|
204
|
+
const nextState = { ...current };
|
|
205
|
+
|
|
206
|
+
for (const [key, value] of Object.entries(updates)) {
|
|
207
|
+
// Skip internal version field from updates
|
|
208
|
+
if (key === '_version') continue;
|
|
209
|
+
|
|
210
|
+
if (value === null) {
|
|
211
|
+
nextState[key] = null;
|
|
212
|
+
} else if (
|
|
213
|
+
value && typeof value === 'object' && !Array.isArray(value) &&
|
|
214
|
+
nextState[key] && typeof nextState[key] === 'object' && !Array.isArray(nextState[key])
|
|
215
|
+
) {
|
|
216
|
+
nextState[key] = { ...nextState[key], ...value };
|
|
217
|
+
} else {
|
|
218
|
+
nextState[key] = value;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Preserve version for write (writeInvestigation will increment it)
|
|
223
|
+
nextState._version = initialVersion;
|
|
224
|
+
|
|
225
|
+
writeInvestigation(nextState, basePath);
|
|
226
|
+
|
|
227
|
+
// Re-read to verify our write succeeded
|
|
228
|
+
const afterWrite = readInvestigation(basePath);
|
|
229
|
+
if (afterWrite && afterWrite._version === initialVersion + 1) {
|
|
230
|
+
return afterWrite; // Success
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Version conflict - retry after brief delay
|
|
234
|
+
if (attempt < MAX_RETRIES - 1) {
|
|
235
|
+
const delay = Math.floor(Math.random() * 50) + 10;
|
|
236
|
+
const start = Date.now();
|
|
237
|
+
while (Date.now() - start < delay) {
|
|
238
|
+
// Busy wait (synchronous delay)
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// All retries exhausted
|
|
244
|
+
console.error('[WARN] updateInvestigation: max retries exceeded, possible version conflict');
|
|
245
|
+
return readInvestigation(basePath);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Initialize a new investigation
|
|
250
|
+
* @param {object} options
|
|
251
|
+
* @param {string} basePath
|
|
252
|
+
* @returns {object}
|
|
253
|
+
*/
|
|
254
|
+
function initializeInvestigation(options = {}, basePath = process.cwd()) {
|
|
255
|
+
const id = options.id || generateInvestigationId();
|
|
256
|
+
const phase = options.phase || PHASES[0];
|
|
257
|
+
|
|
258
|
+
if (!PHASES.includes(phase)) {
|
|
259
|
+
throw new Error(`Invalid perf phase: ${phase}`);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const state = {
|
|
263
|
+
schemaVersion: SCHEMA_VERSION,
|
|
264
|
+
id,
|
|
265
|
+
status: 'in_progress',
|
|
266
|
+
phase,
|
|
267
|
+
createdAt: new Date().toISOString(),
|
|
268
|
+
updatedAt: new Date().toISOString(),
|
|
269
|
+
scenario: {
|
|
270
|
+
description: options.scenario || '',
|
|
271
|
+
metrics: options.metrics || [],
|
|
272
|
+
successCriteria: options.successCriteria || '',
|
|
273
|
+
scenarios: Array.isArray(options.scenarios) ? options.scenarios : []
|
|
274
|
+
},
|
|
275
|
+
baselines: [],
|
|
276
|
+
hypotheses: [],
|
|
277
|
+
codePaths: [],
|
|
278
|
+
experiments: [],
|
|
279
|
+
results: [],
|
|
280
|
+
breakingPoint: null,
|
|
281
|
+
breakingPointHistory: [],
|
|
282
|
+
constraintResults: [],
|
|
283
|
+
profilingResults: [],
|
|
284
|
+
decision: null
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
assertValid(validateInvestigationState(state), 'Invalid initial investigation state');
|
|
288
|
+
writeInvestigation(state, basePath);
|
|
289
|
+
return state;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Append a line to the investigation log
|
|
294
|
+
* @param {string} id
|
|
295
|
+
* @param {string} content
|
|
296
|
+
* @param {string} basePath
|
|
297
|
+
*/
|
|
298
|
+
function appendInvestigationLog(id, content, basePath = process.cwd()) {
|
|
299
|
+
if (!content) return;
|
|
300
|
+
const logPath = getInvestigationLogPath(id, basePath);
|
|
301
|
+
const entry = content.endsWith('\n') ? content : `${content}\n`;
|
|
302
|
+
fs.appendFileSync(logPath, entry, 'utf8');
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Append a baseline section to the investigation log
|
|
307
|
+
* @param {object} input
|
|
308
|
+
* @param {string} input.id
|
|
309
|
+
* @param {string} input.userQuote
|
|
310
|
+
* @param {string} input.command
|
|
311
|
+
* @param {object} input.metrics
|
|
312
|
+
* @param {string} input.baselinePath
|
|
313
|
+
* @param {number} [input.duration]
|
|
314
|
+
* @param {number} [input.runs]
|
|
315
|
+
* @param {string} [input.aggregate]
|
|
316
|
+
* @param {string} [input.date]
|
|
317
|
+
* @param {string} basePath
|
|
318
|
+
*/
|
|
319
|
+
function appendBaselineLog(input, basePath = process.cwd()) {
|
|
320
|
+
if (!input || typeof input !== 'object') {
|
|
321
|
+
throw new Error('appendBaselineLog requires an input object');
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
const { id, userQuote, command, metrics, baselinePath, date, scenarios, duration, runs, aggregate } = input;
|
|
325
|
+
|
|
326
|
+
if (!id || typeof id !== 'string') {
|
|
327
|
+
throw new Error('appendBaselineLog requires a valid investigation id');
|
|
328
|
+
}
|
|
329
|
+
if (!userQuote || typeof userQuote !== 'string') {
|
|
330
|
+
throw new Error('appendBaselineLog requires a non-empty userQuote');
|
|
331
|
+
}
|
|
332
|
+
if (!command || typeof command !== 'string') {
|
|
333
|
+
throw new Error('appendBaselineLog requires a non-empty command');
|
|
334
|
+
}
|
|
335
|
+
if (!metrics || typeof metrics !== 'object' || Array.isArray(metrics)) {
|
|
336
|
+
throw new Error('appendBaselineLog requires a metrics object');
|
|
337
|
+
}
|
|
338
|
+
if (!baselinePath || typeof baselinePath !== 'string') {
|
|
339
|
+
throw new Error('appendBaselineLog requires a baselinePath');
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
const logDate = date || new Date().toISOString().slice(0, 10);
|
|
343
|
+
const metricsText = JSON.stringify(metrics);
|
|
344
|
+
const scenarioText = Array.isArray(scenarios) && scenarios.length > 0
|
|
345
|
+
? scenarios.map((scenario) => scenario.name).filter(Boolean).join(', ')
|
|
346
|
+
: '';
|
|
347
|
+
const durationLine = Number.isFinite(duration) ? `- Duration: ${duration}s` : null;
|
|
348
|
+
const runsLine = Number.isFinite(runs) ? `- Runs: ${runs}` : null;
|
|
349
|
+
const aggregateLine = aggregate ? `- Aggregate: ${aggregate}` : null;
|
|
350
|
+
|
|
351
|
+
const entry = [
|
|
352
|
+
`## Baseline - ${logDate}`,
|
|
353
|
+
'',
|
|
354
|
+
`**User Quote:** "${userQuote}"`,
|
|
355
|
+
'',
|
|
356
|
+
'**Summary**',
|
|
357
|
+
scenarioText ? `- Scenarios: ${scenarioText}` : null,
|
|
358
|
+
`- Baseline command: \`${command}\``,
|
|
359
|
+
durationLine,
|
|
360
|
+
runsLine,
|
|
361
|
+
aggregateLine,
|
|
362
|
+
`- Metrics: ${metricsText}`,
|
|
363
|
+
'',
|
|
364
|
+
'**Evidence**',
|
|
365
|
+
`- Baseline file: ${baselinePath}`,
|
|
366
|
+
''
|
|
367
|
+
].filter(Boolean).join('\n');
|
|
368
|
+
|
|
369
|
+
appendInvestigationLog(id, entry, basePath);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Append a profiling section to the investigation log
|
|
374
|
+
* @param {object} input
|
|
375
|
+
* @param {string} input.id
|
|
376
|
+
* @param {string} input.userQuote
|
|
377
|
+
* @param {string} input.tool
|
|
378
|
+
* @param {string} input.command
|
|
379
|
+
* @param {string[]} input.artifacts
|
|
380
|
+
* @param {string[]} input.hotspots
|
|
381
|
+
* @param {string} [input.date]
|
|
382
|
+
* @param {string} basePath
|
|
383
|
+
*/
|
|
384
|
+
function appendProfilingLog(input, basePath = process.cwd()) {
|
|
385
|
+
if (!input || typeof input !== 'object') {
|
|
386
|
+
throw new Error('appendProfilingLog requires an input object');
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
const { id, userQuote, tool, command, artifacts, hotspots, date } = input;
|
|
390
|
+
|
|
391
|
+
if (!id || typeof id !== 'string') {
|
|
392
|
+
throw new Error('appendProfilingLog requires a valid investigation id');
|
|
393
|
+
}
|
|
394
|
+
if (!userQuote || typeof userQuote !== 'string') {
|
|
395
|
+
throw new Error('appendProfilingLog requires a non-empty userQuote');
|
|
396
|
+
}
|
|
397
|
+
if (!tool || typeof tool !== 'string') {
|
|
398
|
+
throw new Error('appendProfilingLog requires a tool');
|
|
399
|
+
}
|
|
400
|
+
if (!command || typeof command !== 'string') {
|
|
401
|
+
throw new Error('appendProfilingLog requires a command');
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
const logDate = date || new Date().toISOString().slice(0, 10);
|
|
405
|
+
const artifactList = Array.isArray(artifacts) ? artifacts : [];
|
|
406
|
+
const hotspotList = Array.isArray(hotspots) ? hotspots : [];
|
|
407
|
+
|
|
408
|
+
const entry = [
|
|
409
|
+
`## Profiling - ${logDate}`,
|
|
410
|
+
'',
|
|
411
|
+
`**User Quote:** "${userQuote}"`,
|
|
412
|
+
'',
|
|
413
|
+
'**Summary**',
|
|
414
|
+
`- Tool: ${tool}`,
|
|
415
|
+
`- Command: \`${command}\``,
|
|
416
|
+
'',
|
|
417
|
+
'**Evidence**',
|
|
418
|
+
artifactList.length ? `- Artifacts: ${artifactList.join(', ')}` : '- Artifacts: n/a',
|
|
419
|
+
hotspotList.length ? `- Hotspots: ${hotspotList.join(', ')}` : '- Hotspots: n/a',
|
|
420
|
+
''
|
|
421
|
+
].join('\n');
|
|
422
|
+
|
|
423
|
+
appendInvestigationLog(id, entry, basePath);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Append a decision section to the investigation log
|
|
428
|
+
* @param {object} input
|
|
429
|
+
* @param {string} input.id
|
|
430
|
+
* @param {string} input.userQuote
|
|
431
|
+
* @param {string} input.verdict
|
|
432
|
+
* @param {string} input.rationale
|
|
433
|
+
* @param {string} [input.date]
|
|
434
|
+
* @param {string} basePath
|
|
435
|
+
*/
|
|
436
|
+
function appendDecisionLog(input, basePath = process.cwd()) {
|
|
437
|
+
if (!input || typeof input !== 'object') {
|
|
438
|
+
throw new Error('appendDecisionLog requires an input object');
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
const { id, userQuote, verdict, rationale, date, resultsCount } = input;
|
|
442
|
+
|
|
443
|
+
if (!id || typeof id !== 'string') {
|
|
444
|
+
throw new Error('appendDecisionLog requires a valid investigation id');
|
|
445
|
+
}
|
|
446
|
+
if (!userQuote || typeof userQuote !== 'string') {
|
|
447
|
+
throw new Error('appendDecisionLog requires a non-empty userQuote');
|
|
448
|
+
}
|
|
449
|
+
if (!verdict || typeof verdict !== 'string') {
|
|
450
|
+
throw new Error('appendDecisionLog requires a verdict');
|
|
451
|
+
}
|
|
452
|
+
if (!rationale || typeof rationale !== 'string') {
|
|
453
|
+
throw new Error('appendDecisionLog requires a rationale');
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
const logDate = date || new Date().toISOString().slice(0, 10);
|
|
457
|
+
const resultCountText = typeof resultsCount === 'number' ? String(resultsCount) : 'n/a';
|
|
458
|
+
|
|
459
|
+
const entry = [
|
|
460
|
+
`## Decision - ${logDate}`,
|
|
461
|
+
'',
|
|
462
|
+
`**User Quote:** "${userQuote}"`,
|
|
463
|
+
'',
|
|
464
|
+
'**Summary**',
|
|
465
|
+
`- Verdict: ${verdict}`,
|
|
466
|
+
`- Rationale: ${rationale}`,
|
|
467
|
+
'',
|
|
468
|
+
'**Evidence**',
|
|
469
|
+
`- Results count: ${resultCountText}`,
|
|
470
|
+
''
|
|
471
|
+
].join('\n');
|
|
472
|
+
|
|
473
|
+
appendInvestigationLog(id, entry, basePath);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Append a setup section to the investigation log
|
|
478
|
+
* @param {object} input
|
|
479
|
+
* @param {string} input.id
|
|
480
|
+
* @param {string} input.userQuote
|
|
481
|
+
* @param {string} input.scenario
|
|
482
|
+
* @param {string} input.command
|
|
483
|
+
* @param {string} input.version
|
|
484
|
+
* @param {number} [input.duration]
|
|
485
|
+
* @param {number} [input.runs]
|
|
486
|
+
* @param {string} [input.aggregate]
|
|
487
|
+
* @param {string} [input.date]
|
|
488
|
+
* @param {string} basePath
|
|
489
|
+
*/
|
|
490
|
+
function appendSetupLog(input, basePath = process.cwd()) {
|
|
491
|
+
if (!input || typeof input !== 'object') {
|
|
492
|
+
throw new Error('appendSetupLog requires an input object');
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
const { id, userQuote, scenario, command, version, duration, runs, aggregate, date } = input;
|
|
496
|
+
|
|
497
|
+
if (!id || typeof id !== 'string') {
|
|
498
|
+
throw new Error('appendSetupLog requires a valid investigation id');
|
|
499
|
+
}
|
|
500
|
+
if (!userQuote || typeof userQuote !== 'string') {
|
|
501
|
+
throw new Error('appendSetupLog requires a non-empty userQuote');
|
|
502
|
+
}
|
|
503
|
+
if (!scenario || typeof scenario !== 'string') {
|
|
504
|
+
throw new Error('appendSetupLog requires a scenario');
|
|
505
|
+
}
|
|
506
|
+
if (!command || typeof command !== 'string') {
|
|
507
|
+
throw new Error('appendSetupLog requires a command');
|
|
508
|
+
}
|
|
509
|
+
if (!version || typeof version !== 'string') {
|
|
510
|
+
throw new Error('appendSetupLog requires a version');
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
const logDate = date || new Date().toISOString().slice(0, 10);
|
|
514
|
+
const durationLine = Number.isFinite(duration) ? `- Duration: ${duration}s` : null;
|
|
515
|
+
const runsLine = Number.isFinite(runs) ? `- Runs: ${runs}` : null;
|
|
516
|
+
const aggregateLine = aggregate ? `- Aggregate: ${aggregate}` : null;
|
|
517
|
+
const entry = [
|
|
518
|
+
`## Setup - ${logDate}`,
|
|
519
|
+
'',
|
|
520
|
+
`**User Quote:** "${userQuote}"`,
|
|
521
|
+
'',
|
|
522
|
+
'**Summary**',
|
|
523
|
+
`- Scenario: ${scenario}`,
|
|
524
|
+
`- Command: \`${command}\``,
|
|
525
|
+
`- Version: ${version}`,
|
|
526
|
+
durationLine,
|
|
527
|
+
runsLine,
|
|
528
|
+
aggregateLine,
|
|
529
|
+
'',
|
|
530
|
+
'**Evidence**',
|
|
531
|
+
`- Command: \`${command}\``,
|
|
532
|
+
`- Version: ${version}`,
|
|
533
|
+
''
|
|
534
|
+
].filter(Boolean).join('\n');
|
|
535
|
+
|
|
536
|
+
appendInvestigationLog(id, entry, basePath);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Append a breaking point section to the investigation log
|
|
541
|
+
* @param {object} input
|
|
542
|
+
* @param {string} input.id
|
|
543
|
+
* @param {string} input.userQuote
|
|
544
|
+
* @param {string} input.paramEnv
|
|
545
|
+
* @param {number} input.min
|
|
546
|
+
* @param {number} input.max
|
|
547
|
+
* @param {number|null} input.breakingPoint
|
|
548
|
+
* @param {string} [input.date]
|
|
549
|
+
* @param {string} basePath
|
|
550
|
+
*/
|
|
551
|
+
function appendBreakingPointLog(input, basePath = process.cwd()) {
|
|
552
|
+
if (!input || typeof input !== 'object') {
|
|
553
|
+
throw new Error('appendBreakingPointLog requires an input object');
|
|
554
|
+
}
|
|
555
|
+
const { id, userQuote, paramEnv, min, max, breakingPoint, history, date } = input;
|
|
556
|
+
|
|
557
|
+
if (!id || typeof id !== 'string') {
|
|
558
|
+
throw new Error('appendBreakingPointLog requires a valid investigation id');
|
|
559
|
+
}
|
|
560
|
+
if (!userQuote || typeof userQuote !== 'string') {
|
|
561
|
+
throw new Error('appendBreakingPointLog requires a non-empty userQuote');
|
|
562
|
+
}
|
|
563
|
+
if (!paramEnv || typeof paramEnv !== 'string') {
|
|
564
|
+
throw new Error('appendBreakingPointLog requires a paramEnv');
|
|
565
|
+
}
|
|
566
|
+
if (typeof min !== 'number' || typeof max !== 'number') {
|
|
567
|
+
throw new Error('appendBreakingPointLog requires numeric min/max');
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
const logDate = date || new Date().toISOString().slice(0, 10);
|
|
571
|
+
const historyText = Array.isArray(history) ? JSON.stringify(history) : 'n/a';
|
|
572
|
+
const entry = [
|
|
573
|
+
`## Breaking Point - ${logDate}`,
|
|
574
|
+
'',
|
|
575
|
+
`**User Quote:** "${userQuote}"`,
|
|
576
|
+
'',
|
|
577
|
+
'**Summary**',
|
|
578
|
+
`- Param env: ${paramEnv}`,
|
|
579
|
+
`- Range: ${min}..${max}`,
|
|
580
|
+
`- Breaking point: ${breakingPoint ?? 'n/a'}`,
|
|
581
|
+
'',
|
|
582
|
+
'**Evidence**',
|
|
583
|
+
`- History: ${historyText}`,
|
|
584
|
+
''
|
|
585
|
+
].join('\n');
|
|
586
|
+
|
|
587
|
+
appendInvestigationLog(id, entry, basePath);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Append a constraints section to the investigation log
|
|
592
|
+
* @param {object} input
|
|
593
|
+
* @param {string} input.id
|
|
594
|
+
* @param {string} input.userQuote
|
|
595
|
+
* @param {object} input.constraints
|
|
596
|
+
* @param {object} input.delta
|
|
597
|
+
* @param {string} [input.date]
|
|
598
|
+
* @param {string} basePath
|
|
599
|
+
*/
|
|
600
|
+
function appendConstraintLog(input, basePath = process.cwd()) {
|
|
601
|
+
if (!input || typeof input !== 'object') {
|
|
602
|
+
throw new Error('appendConstraintLog requires an input object');
|
|
603
|
+
}
|
|
604
|
+
const { id, userQuote, constraints, delta, date } = input;
|
|
605
|
+
|
|
606
|
+
if (!id || typeof id !== 'string') {
|
|
607
|
+
throw new Error('appendConstraintLog requires a valid investigation id');
|
|
608
|
+
}
|
|
609
|
+
if (!userQuote || typeof userQuote !== 'string') {
|
|
610
|
+
throw new Error('appendConstraintLog requires a non-empty userQuote');
|
|
611
|
+
}
|
|
612
|
+
if (!constraints || typeof constraints !== 'object') {
|
|
613
|
+
throw new Error('appendConstraintLog requires constraints');
|
|
614
|
+
}
|
|
615
|
+
if (!delta || typeof delta !== 'object') {
|
|
616
|
+
throw new Error('appendConstraintLog requires delta');
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
const logDate = date || new Date().toISOString().slice(0, 10);
|
|
620
|
+
const entry = [
|
|
621
|
+
`## Constraints - ${logDate}`,
|
|
622
|
+
'',
|
|
623
|
+
`**User Quote:** "${userQuote}"`,
|
|
624
|
+
'',
|
|
625
|
+
'**Summary**',
|
|
626
|
+
`- CPU: ${constraints.cpu || 'n/a'}`,
|
|
627
|
+
`- Memory: ${constraints.memory || 'n/a'}`,
|
|
628
|
+
'',
|
|
629
|
+
'**Evidence**',
|
|
630
|
+
`- Delta: ${JSON.stringify(delta.metrics || {})}`,
|
|
631
|
+
''
|
|
632
|
+
].join('\n');
|
|
633
|
+
|
|
634
|
+
appendInvestigationLog(id, entry, basePath);
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Append a hypotheses section to the investigation log
|
|
639
|
+
* @param {object} input
|
|
640
|
+
* @param {string} input.id
|
|
641
|
+
* @param {string} input.userQuote
|
|
642
|
+
* @param {Array} input.hypotheses
|
|
643
|
+
* @param {string} [input.date]
|
|
644
|
+
* @param {string} basePath
|
|
645
|
+
*/
|
|
646
|
+
function appendHypothesesLog(input, basePath = process.cwd()) {
|
|
647
|
+
if (!input || typeof input !== 'object') {
|
|
648
|
+
throw new Error('appendHypothesesLog requires an input object');
|
|
649
|
+
}
|
|
650
|
+
const { id, userQuote, hypotheses, date, gitHistory, hypothesesFile } = input;
|
|
651
|
+
|
|
652
|
+
if (!id || typeof id !== 'string') {
|
|
653
|
+
throw new Error('appendHypothesesLog requires a valid investigation id');
|
|
654
|
+
}
|
|
655
|
+
if (!userQuote || typeof userQuote !== 'string') {
|
|
656
|
+
throw new Error('appendHypothesesLog requires a non-empty userQuote');
|
|
657
|
+
}
|
|
658
|
+
if (!Array.isArray(hypotheses)) {
|
|
659
|
+
throw new Error('appendHypothesesLog requires hypotheses array');
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
const logDate = date || new Date().toISOString().slice(0, 10);
|
|
663
|
+
const lines = hypotheses.map((item) => {
|
|
664
|
+
if (!item) return null;
|
|
665
|
+
const label = item.id ? `${item.id}: ` : '';
|
|
666
|
+
const evidence = item.evidence ? ` (evidence: ${item.evidence})` : '';
|
|
667
|
+
const confidence = item.confidence ? ` [${item.confidence}]` : '';
|
|
668
|
+
return `- ${label}${item.hypothesis || 'n/a'}${confidence}${evidence}`;
|
|
669
|
+
}).filter(Boolean);
|
|
670
|
+
|
|
671
|
+
const entry = [
|
|
672
|
+
`## Hypotheses - ${logDate}`,
|
|
673
|
+
'',
|
|
674
|
+
`**User Quote:** "${userQuote}"`,
|
|
675
|
+
'',
|
|
676
|
+
'**Summary**',
|
|
677
|
+
lines.length > 0 ? lines.join('\n') : '- n/a',
|
|
678
|
+
'',
|
|
679
|
+
'**Evidence**',
|
|
680
|
+
`- Git history: ${Array.isArray(gitHistory) && gitHistory.length ? gitHistory.join(' | ') : 'n/a'}`,
|
|
681
|
+
hypothesesFile ? `- Hypotheses file: ${hypothesesFile}` : null,
|
|
682
|
+
''
|
|
683
|
+
].join('\n');
|
|
684
|
+
|
|
685
|
+
appendInvestigationLog(id, entry, basePath);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Append a code-paths section to the investigation log
|
|
690
|
+
* @param {object} input
|
|
691
|
+
* @param {string} input.id
|
|
692
|
+
* @param {string} input.userQuote
|
|
693
|
+
* @param {string[]} input.keywords
|
|
694
|
+
* @param {Array} input.paths
|
|
695
|
+
* @param {string} [input.date]
|
|
696
|
+
* @param {string} basePath
|
|
697
|
+
*/
|
|
698
|
+
function appendCodePathsLog(input, basePath = process.cwd()) {
|
|
699
|
+
if (!input || typeof input !== 'object') {
|
|
700
|
+
throw new Error('appendCodePathsLog requires an input object');
|
|
701
|
+
}
|
|
702
|
+
const { id, userQuote, keywords, paths, date, repoMapStatus } = input;
|
|
703
|
+
|
|
704
|
+
if (!id || typeof id !== 'string') {
|
|
705
|
+
throw new Error('appendCodePathsLog requires a valid investigation id');
|
|
706
|
+
}
|
|
707
|
+
if (!userQuote || typeof userQuote !== 'string') {
|
|
708
|
+
throw new Error('appendCodePathsLog requires a non-empty userQuote');
|
|
709
|
+
}
|
|
710
|
+
if (!Array.isArray(paths)) {
|
|
711
|
+
throw new Error('appendCodePathsLog requires paths array');
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
const logDate = date || new Date().toISOString().slice(0, 10);
|
|
715
|
+
const keywordText = Array.isArray(keywords) && keywords.length > 0 ? keywords.join(', ') : 'n/a';
|
|
716
|
+
const pathLines = paths.map((pathEntry) => {
|
|
717
|
+
const file = pathEntry.file || 'n/a';
|
|
718
|
+
const score = typeof pathEntry.score === 'number' ? ` (score: ${pathEntry.score})` : '';
|
|
719
|
+
const symbols = Array.isArray(pathEntry.symbols) && pathEntry.symbols.length > 0
|
|
720
|
+
? ` [${pathEntry.symbols.join(', ')}]`
|
|
721
|
+
: '';
|
|
722
|
+
return `- ${file}${score}${symbols}`;
|
|
723
|
+
});
|
|
724
|
+
|
|
725
|
+
const entry = [
|
|
726
|
+
`## Code Paths - ${logDate}`,
|
|
727
|
+
'',
|
|
728
|
+
`**User Quote:** "${userQuote}"`,
|
|
729
|
+
'',
|
|
730
|
+
'**Summary**',
|
|
731
|
+
`- Keywords: ${keywordText}`,
|
|
732
|
+
pathLines.length > 0 ? pathLines.join('\n') : '- n/a',
|
|
733
|
+
'',
|
|
734
|
+
'**Evidence**',
|
|
735
|
+
`- Repo map: ${repoMapStatus || 'n/a'}`,
|
|
736
|
+
`- Paths count: ${pathLines.length}`,
|
|
737
|
+
''
|
|
738
|
+
].join('\n');
|
|
739
|
+
|
|
740
|
+
appendInvestigationLog(id, entry, basePath);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Append an optimization section to the investigation log
|
|
745
|
+
* @param {object} input
|
|
746
|
+
* @param {string} input.id
|
|
747
|
+
* @param {string} input.userQuote
|
|
748
|
+
* @param {string} input.change
|
|
749
|
+
* @param {object} input.delta
|
|
750
|
+
* @param {string} input.verdict
|
|
751
|
+
* @param {number} [input.runs]
|
|
752
|
+
* @param {string} [input.aggregate]
|
|
753
|
+
* @param {string} [input.date]
|
|
754
|
+
* @param {string} basePath
|
|
755
|
+
*/
|
|
756
|
+
function appendOptimizationLog(input, basePath = process.cwd()) {
|
|
757
|
+
if (!input || typeof input !== 'object') {
|
|
758
|
+
throw new Error('appendOptimizationLog requires an input object');
|
|
759
|
+
}
|
|
760
|
+
const { id, userQuote, change, delta, verdict, date, gitHistory, runs, aggregate } = input;
|
|
761
|
+
|
|
762
|
+
if (!id || typeof id !== 'string') {
|
|
763
|
+
throw new Error('appendOptimizationLog requires a valid investigation id');
|
|
764
|
+
}
|
|
765
|
+
if (!userQuote || typeof userQuote !== 'string') {
|
|
766
|
+
throw new Error('appendOptimizationLog requires a non-empty userQuote');
|
|
767
|
+
}
|
|
768
|
+
if (!change || typeof change !== 'string') {
|
|
769
|
+
throw new Error('appendOptimizationLog requires a change summary');
|
|
770
|
+
}
|
|
771
|
+
if (!delta || typeof delta !== 'object') {
|
|
772
|
+
throw new Error('appendOptimizationLog requires delta');
|
|
773
|
+
}
|
|
774
|
+
if (!verdict || typeof verdict !== 'string') {
|
|
775
|
+
throw new Error('appendOptimizationLog requires a verdict');
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
const logDate = date || new Date().toISOString().slice(0, 10);
|
|
779
|
+
const gitHistoryText = Array.isArray(gitHistory) && gitHistory.length
|
|
780
|
+
? gitHistory.join(' | ')
|
|
781
|
+
: 'n/a';
|
|
782
|
+
const runsLine = Number.isFinite(runs) ? `- Runs: ${runs}` : null;
|
|
783
|
+
const aggregateLine = aggregate ? `- Aggregate: ${aggregate}` : null;
|
|
784
|
+
const entry = [
|
|
785
|
+
`## Optimization - ${logDate}`,
|
|
786
|
+
'',
|
|
787
|
+
`**User Quote:** "${userQuote}"`,
|
|
788
|
+
'',
|
|
789
|
+
'**Summary**',
|
|
790
|
+
`- Change: ${change}`,
|
|
791
|
+
`- Verdict: ${verdict}`,
|
|
792
|
+
runsLine,
|
|
793
|
+
aggregateLine,
|
|
794
|
+
'',
|
|
795
|
+
'**Evidence**',
|
|
796
|
+
`- Delta: ${JSON.stringify(delta.metrics || {})}`,
|
|
797
|
+
`- Git history: ${gitHistoryText}`,
|
|
798
|
+
''
|
|
799
|
+
].join('\n');
|
|
800
|
+
|
|
801
|
+
appendInvestigationLog(id, entry, basePath);
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Append a consolidation section to the investigation log
|
|
806
|
+
* @param {object} input
|
|
807
|
+
* @param {string} input.id
|
|
808
|
+
* @param {string} input.userQuote
|
|
809
|
+
* @param {string} input.version
|
|
810
|
+
* @param {string} input.path
|
|
811
|
+
* @param {string} [input.date]
|
|
812
|
+
* @param {string} basePath
|
|
813
|
+
*/
|
|
814
|
+
function appendConsolidationLog(input, basePath = process.cwd()) {
|
|
815
|
+
if (!input || typeof input !== 'object') {
|
|
816
|
+
throw new Error('appendConsolidationLog requires an input object');
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
const { id, userQuote, version, path, date } = input;
|
|
820
|
+
|
|
821
|
+
if (!id || typeof id !== 'string') {
|
|
822
|
+
throw new Error('appendConsolidationLog requires a valid investigation id');
|
|
823
|
+
}
|
|
824
|
+
if (!userQuote || typeof userQuote !== 'string') {
|
|
825
|
+
throw new Error('appendConsolidationLog requires a non-empty userQuote');
|
|
826
|
+
}
|
|
827
|
+
if (!version || typeof version !== 'string') {
|
|
828
|
+
throw new Error('appendConsolidationLog requires a version');
|
|
829
|
+
}
|
|
830
|
+
if (!path || typeof path !== 'string') {
|
|
831
|
+
throw new Error('appendConsolidationLog requires a path');
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
const logDate = date || new Date().toISOString().slice(0, 10);
|
|
835
|
+
const entry = [
|
|
836
|
+
`## Consolidation - ${logDate}`,
|
|
837
|
+
'',
|
|
838
|
+
`**User Quote:** "${userQuote}"`,
|
|
839
|
+
'',
|
|
840
|
+
'**Summary**',
|
|
841
|
+
`- Version: ${version}`,
|
|
842
|
+
`- Baseline file: ${path}`,
|
|
843
|
+
'',
|
|
844
|
+
'**Evidence**',
|
|
845
|
+
`- Baseline file: ${path}`,
|
|
846
|
+
''
|
|
847
|
+
].join('\n');
|
|
848
|
+
|
|
849
|
+
appendInvestigationLog(id, entry, basePath);
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
module.exports = {
|
|
853
|
+
SCHEMA_VERSION,
|
|
854
|
+
PHASES,
|
|
855
|
+
generateInvestigationId,
|
|
856
|
+
getPerfDir,
|
|
857
|
+
ensurePerfDirs,
|
|
858
|
+
getInvestigationPath,
|
|
859
|
+
getInvestigationLogPath,
|
|
860
|
+
readInvestigation,
|
|
861
|
+
writeInvestigation,
|
|
862
|
+
updateInvestigation,
|
|
863
|
+
initializeInvestigation,
|
|
864
|
+
appendInvestigationLog,
|
|
865
|
+
appendBaselineLog,
|
|
866
|
+
appendProfilingLog,
|
|
867
|
+
appendDecisionLog,
|
|
868
|
+
appendSetupLog,
|
|
869
|
+
appendBreakingPointLog,
|
|
870
|
+
appendConstraintLog,
|
|
871
|
+
appendHypothesesLog,
|
|
872
|
+
appendCodePathsLog,
|
|
873
|
+
appendOptimizationLog,
|
|
874
|
+
appendConsolidationLog
|
|
875
|
+
};
|