Files
ci/src/types/config.ts
T
Jon Chery 8e50049ba5 feat(P01): add ideation engine + ciagent ideate command — IDEATE-01,02,03,17 + MULTI-01
---ci---
phase: 1
milestone: v0.10
status: execute
decisions:
  - id: D-080
    decision: Three-tier ideation (mechanical, backend-enriched, cross-project)
    rationale: Mechanical tier always produces output without backend
    confidence: 0.92
  - id: D-089
    decision: No separate codebase map command
    rationale: Git-native + .ciagent/ covers mapping; avoids tree-sitter dep
    confidence: 0.88
requirements:
  covered:
    - IDEATE-01
    - IDEATE-02
    - IDEATE-03
    - IDEATE-17
    - MULTI-01
---/ci---

Add IdeationEngine core module with 15 signal collectors:
- Uncovered/partial requirements from REQUIREMENTS.md
- Coverage gaps (documented but unimplemented agents)
- Repeated lessons from git history
- Low-confidence decisions from ---ci--- blocks
- Escalation patterns from git history
- Compound solution patterns
- Architecture drift (ARCHITECTURE.md vs src/)
- Verification inversion (missing test files)
- Improvement patterns (cross-referencing lessons + requirements)
- Spec ambiguity (should/could/might patterns)
- Spec missing (common requirement categories)
- Cascade impact (--affected from git diff)
- External signals (npm audit, dependency staleness)
- Cross-project lesson mining

Add ciagent ideate CLI command with flags:
--category, --affected, --spec, --external, --cross-project, --output

Add active_projects to CIAgentConfig (backwards compatible with active_project).
Add IDEATE pipeline stage between RESEARCH and PLAN.
Update IdeationAgent to delegate to IdeationEngine.

533 tests passing.
2026-05-30 20:13:43 +00:00

191 lines
4.5 KiB
TypeScript

import { BackendConfigSection } from "../backends/types.js";
import { IdeationConfig, IdeationCategory } from "./ideation.js";
export type AutonomyLevel = "full" | "supervised" | "guided";
export type ModelProfile = "quality" | "speed" | "balanced";
export type BranchingStrategy = "phase" | "feature" | "trunk";
export type MilestoneType = "nfr" | "feature" | "schema-breaking";
export type PhaseName = "research" | "plan" | "execute" | "verify" | "complete";
export type AgentName =
| "orchestrator"
| "planner"
| "executor"
| "verifier"
| "researcher"
| "phase-researcher"
| "challenger"
| "security-auditor"
| "debugger"
| "doc-writer"
| "doc-verifier"
| "code-reviewer"
| "ideation-agent"
| "roadmapper"
| "plan-checker"
| "project-researcher"
| "research-synthesizer"
| "solution-writer"
| "tester";
export interface AutonomyConfig {
level: AutonomyLevel;
escalation_hooks: string[];
clarify_budget: number;
decision_confidence_threshold: number;
max_revision_iterations: number;
max_verification_retries: number;
escalation_timeout_ms: number;
}
export interface ParallelizationConfig {
enabled: boolean;
max_concurrent_agents: number;
min_plans_for_parallel: number;
}
export interface VerificationConfig {
automated_only: boolean;
escalate_visual: boolean;
escalate_external_integration: boolean;
test_first: boolean;
}
export interface SecurityConfig {
auto_accept_low_severity: boolean;
auto_mitigate_medium_severity: boolean;
escalate_high_severity: boolean;
}
export interface GitConfig {
branching_strategy: BranchingStrategy;
auto_commit: boolean;
auto_push: boolean;
}
export interface GiteaConfig {
base_url: string;
api_token_env: string;
owner: string;
repo: string;
}
export interface ProjectEntry {
slug: string;
name: string;
default?: boolean;
}
export interface CIAgentConfig {
projects: ProjectEntry[];
active_project: string;
active_projects: string[];
autonomy: AutonomyConfig;
model_profile: ModelProfile;
parallelization: ParallelizationConfig;
verification: VerificationConfig;
security: SecurityConfig;
git: GitConfig;
backend: BackendConfigSection;
gitea?: GiteaConfig;
ideation?: IdeationConfig;
}
export const DEFAULT_CIAGENT_CONFIG: CIAgentConfig = {
projects: [],
active_project: "",
active_projects: [],
autonomy: {
level: "full",
escalation_hooks: ["deploy", "delete_data", "merge_to_main"],
clarify_budget: 10,
decision_confidence_threshold: 0.6,
max_revision_iterations: 3,
max_verification_retries: 2,
escalation_timeout_ms: 300000,
},
model_profile: "quality",
parallelization: {
enabled: true,
max_concurrent_agents: 5,
min_plans_for_parallel: 2,
},
verification: {
automated_only: true,
escalate_visual: true,
escalate_external_integration: true,
test_first: false,
},
security: {
auto_accept_low_severity: true,
auto_mitigate_medium_severity: true,
escalate_high_severity: true,
},
git: {
branching_strategy: "phase",
auto_commit: true,
auto_push: false,
},
backend: {
provider: "auto",
agent_backends: {
opencode: { enabled: true },
},
llm_backends: {
"openai": {
base_url: "https://api.openai.com/v1",
api_key_env: "OPENAI_API_KEY",
model: "gpt-4o",
model_profile: "quality",
timeout_ms: 60000,
},
"ollama-local": {
base_url: "http://localhost:11434",
model_profile: "balanced",
},
"ollama-cloud": {
base_url: "",
api_key_env: "OLLAMA_CLOUD_API_KEY",
model_profile: "quality",
timeout_ms: 60000,
},
"anthropic": {
base_url: "https://api.anthropic.com",
api_key_env: "ANTHROPIC_API_KEY",
model: "claude-sonnet-4-20250514",
api_version: "2023-06-01",
model_profile: "quality",
timeout_ms: 60000,
},
},
},
gitea: {
base_url: "https://git.cloudinit.dev",
api_token_env: "GITEA_TOKEN",
owner: "",
repo: "",
},
ideation: {
enabled: true,
categories: ["security", "quality", "architecture", "coverage", "improvement"] as IdeationCategory[],
confidence_threshold: 0.6,
max_ideas: 20,
external_signals: {
npm_audit: true,
osv_advisories: true,
dependency_staleness: true,
},
cross_project: {
enabled: false,
similarity_weight: 0.5,
},
chaos: {
enabled: true,
scenarios: ["backend_unavailable", "requirement_change", "test_coverage_drop"],
},
},
};