Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
b393697
feat(core): Phase 0 - Baseline pipeline mapping and contract freeze
utkarsh232005 Oct 5, 2026
2356a85
Merge pull request #339 from utkarsh232005/feat/v4-phase-0-baseline
utkarsh232005 Oct 5, 2026
bbca695
feat(agents): Phase 2 - Safe Typed Tool Layer & Least-Privilege Registry
utkarsh232005 Oct 7, 2026
9edb8c3
Merge pull request #349 from utkarsh232005/feat/agents-phase2-safe-ty…
utkarsh232005 Oct 7, 2026
6786bea
feat(agents): Phase 1 - Canonical Evidence Model and Collectors
utkarsh232005 Oct 7, 2026
164365a
fix(agents): address review feedback and code health checks for Phase 1
utkarsh232005 Oct 7, 2026
98a3b57
Merge pull request #348 from utkarsh232005/feat/agents-phase1-canonic…
utkarsh232005 Oct 7, 2026
af62692
refactor(agents): improve sanitizer code health and split unit tests …
utkarsh232005 Oct 7, 2026
614cefe
refactor(tests): parameterize target mismatch tests to eliminate code…
utkarsh232005 Oct 7, 2026
59a1a60
Merge pull request #351 from utkarsh232005/fix/agents-phase1-codescen…
utkarsh232005 Oct 8, 2026
e49e598
feat(agents): Phase 3 - Tool Audit Logging and Evidence Store
utkarsh232005 Oct 8, 2026
5c6194c
Merge pull request #352 from utkarsh232005/feat/agents-phase3-tool-au…
utkarsh232005 Oct 8, 2026
ed3c7ba
feat(agents): Phase 4 - Deterministic Diagnostic Rule Engine
utkarsh232005 Oct 8, 2026
ecd5667
refactor(agents): resolve CodeRabbit review comments and CodeScene co…
utkarsh232005 Oct 8, 2026
e333592
refactor(agents): reduce mean cyclomatic complexity and enforce posit…
utkarsh232005 Oct 8, 2026
6e0e164
refactor(agents): resolve CodeScene code health and CodeRabbit review…
utkarsh232005 Oct 8, 2026
8da0454
Merge pull request #354 from utkarsh232005/feat/agents-phase4-determi…
utkarsh232005 Oct 8, 2026
02ffe62
feat(agents): Phase 5 - Structured Specialist Agents (Runtime, Config…
utkarsh232005 Oct 9, 2026
17dca73
refactor(agents): resolve CodeScene code health and CodeRabbit review…
utkarsh232005 Oct 9, 2026
a517acd
refactor(agents): resolve CodeScene code health biomarkers across spe…
utkarsh232005 Oct 9, 2026
735f13d
refactor(tests): split test methods in test_specialists.py to ensure …
utkarsh232005 Oct 9, 2026
9cce505
refactor(tests): parameterize specialist investigation report tests t…
utkarsh232005 Oct 9, 2026
707e035
Merge pull request #356 from utkarsh232005/feat/agents-phase5-structu…
utkarsh232005 Oct 9, 2026
3147897
feat(ci): configure optimized husky and lint-staged git hooks for aut…
utkarsh232005 Oct 9, 2026
eaf2158
Merge pull request #357 from utkarsh232005/feat/husky-code-quality-au…
utkarsh232005 Oct 9, 2026
c66755e
feat(agents): Phase 6 - Parallel Agent Orchestrator with Failure Isol…
utkarsh232005 Oct 9, 2026
9201350
refactor(tests): reduce DummySpecialist constructor arguments to comp…
utkarsh232005 Oct 9, 2026
88a4260
Merge pull request #358 from utkarsh232005/feat/agents-phase6-paralle…
utkarsh232005 Oct 9, 2026
42eb2fe
feat(agents): Phase 7 - Bounded Progressive Tool-Calling Loop
utkarsh232005 Oct 10, 2026
bff9db7
refactor(agents): decompose tool loop helpers and test cases for Code…
utkarsh232005 Oct 10, 2026
6de98b5
Merge pull request #359 from utkarsh232005/feat/agents-phase7-progres…
utkarsh232005 Oct 10, 2026
975e014
feat(agents): Phase 8 - Lead Investigator Hypothesis Engine
utkarsh232005 Oct 10, 2026
624b8c4
refactor(agents): decompose investigator helpers to eliminate CodeSce…
utkarsh232005 Oct 10, 2026
c4665c3
refactor(synthesis): strengthen hypothesis probability validation and…
utkarsh232005 Oct 10, 2026
9dcc968
fix(hypotheses): route non-finite likelihoods strictly to inconclusiv…
utkarsh232005 Oct 10, 2026
4269ca2
Merge pull request #360 from utkarsh232005/feat/agents-phase8-lead-in…
utkarsh232005 Oct 10, 2026
f394b0a
feat(agents): Phase 9 - Cross-Agent Validator and Disagreement Resolu…
utkarsh232005 Oct 10, 2026
8191827
refactor(agents): decompose validator helpers to eliminate CodeScene …
utkarsh232005 Oct 10, 2026
c79560a
refactor(validation): streamline contradiction rules and eliminate pa…
utkarsh232005 Oct 10, 2026
365bfe4
refactor(validation): lower function and overall cyclomatic complexit…
utkarsh232005 Oct 10, 2026
089679c
Merge pull request #361 from utkarsh232005/feat/agents-phase9-cross-a…
utkarsh232005 Oct 10, 2026
cd54fea
feat(agents): Phase 10 - Consensus Diagnosis Schema and Generator
utkarsh232005 Oct 10, 2026
4a9b65b
refactor(synthesis): eliminate CodeScene biomarkers and reduce comple…
utkarsh232005 Oct 10, 2026
4ee6625
refactor(synthesis): flatten sanitization and citation dedup to elimi…
utkarsh232005 Oct 10, 2026
6b1b241
refactor(synthesis): encapsulate options into ConsensusContext to sat…
utkarsh232005 Oct 10, 2026
f444384
Merge pull request #362 from utkarsh232005/feat/agents-phase10-consen…
utkarsh232005 Oct 10, 2026
a627cbe
feat(protocol): Phase 11 - Real-Time NDJSON Streaming Event Protocol
utkarsh232005 Oct 13, 2026
4b8721b
refactor(protocol): harden event validation, protect protocol fields,…
utkarsh232005 Oct 13, 2026
3e6d937
Merge pull request #363 from utkarsh232005/feat/protocol-phase11-ndjs…
utkarsh232005 Oct 13, 2026
b8014b8
feat(core): Phase 12 - Robust Node/Python Subprocess Bridge
utkarsh232005 Oct 14, 2026
f15e900
Update src/agent/python-bridge.ts
utkarsh232005 Oct 14, 2026
b8e593c
Update src/agent/python-bridge.ts
utkarsh232005 Oct 14, 2026
3a456a4
Merge pull request #367 from utkarsh232005/feat/bridge-phase12-subpro…
utkarsh232005 Oct 14, 2026
0c9f7c8
feat(ui): Phase 13 - Live Ink Multi-Agent Triaging Dashboard
utkarsh232005 Oct 14, 2026
44b37e4
refactor(ui): resolve CodeScene code health and static analysis findings
utkarsh232005 Oct 14, 2026
6446991
refactor(ui): resolve updateAgentStatus args and ConsensusDiagnosisVi…
utkarsh232005 Oct 14, 2026
f9d6993
refactor(ui): consolidate agent lifecycle handling and explicit React…
utkarsh232005 Oct 14, 2026
9ab53cb
chore(test): remove unused NDJSONEvent import in events test suite
utkarsh232005 Oct 14, 2026
42c23f9
Merge pull request #368 from utkarsh232005/feat/ui-phase13-live-ink-d…
utkarsh232005 Oct 14, 2026
3b14bf6
feat(remediation): Phase 14 - Structured Remediation Planner
utkarsh232005 Oct 14, 2026
680be97
refactor(remediation): simplify helper methods and remove test duplic…
utkarsh232005 Oct 14, 2026
dc5c0c0
refactor(remediation): resolve CodeScene complex conditional, bumpy r…
utkarsh232005 Oct 14, 2026
5c88d11
Merge pull request #369 from utkarsh232005/feat/remediation-phase14-s…
utkarsh232005 Oct 14, 2026
891f0dc
feat(security): Phase 15 - Remediation Policy Safety Gate & Interacti…
utkarsh232005 Oct 14, 2026
7f484ef
refactor(security): decompose SafetyPrompt and eliminate test duplica…
utkarsh232005 Oct 14, 2026
7822409
refactor(security): reduce cyclomatic complexity in safety-prompt
utkarsh232005 Oct 14, 2026
b801398
refactor(security): eliminate nested conditionals and streamline prom…
utkarsh232005 Oct 14, 2026
e82fcf3
refactor(security): decompose promptSafetyConfirmation to reduce cycl…
utkarsh232005 Oct 14, 2026
b046617
Merge pull request #370 from utkarsh232005/feat/security-phase15-reme…
utkarsh232005 Oct 14, 2026
f3904bf
[KDM-TEST-FEAT-374] feat(remediation): Phase 16 - Auditable Remediati…
utkarsh232005 Oct 16, 2026
ee7d1db
feat(remediation): Phase 17 - Post-Fix Closed-Loop Verification Engin…
utkarsh232005 Oct 16, 2026
82498c0
feat(core): Phase 18 - System Failure Handling, Graceful Degradation …
utkarsh232005 Oct 16, 2026
b13ab05
refactor(core): streamline fallback ladder and eliminate test duplica…
utkarsh232005 Oct 16, 2026
da746b5
refactor(core): resolve CodeScene complexity, test duplication, and D…
utkarsh232005 Oct 16, 2026
fe537cf
refactor(rules): simplify detectCrashFacts and pattern extraction for…
utkarsh232005 Oct 16, 2026
96df916
[KDM-TEST-FEAT-376] feat(core): Phase 18 - System Failure Handling, G…
utkarsh232005 Oct 16, 2026
611d797
feat(observability): Phase 19 - System Observability, Secret Redactio…
utkarsh232005 Oct 16, 2026
14f722b
refactor(observability): simplify audit exporter and parameter valida…
utkarsh232005 Oct 16, 2026
682626d
refactor(observability): simplify createIncidentAuditSession for Code…
utkarsh232005 Oct 16, 2026
29e241b
Merge pull request #377 from utkarsh232005/feat/observability-phase19…
utkarsh232005 Oct 16, 2026
788f243
test(agents): Phase 20 - Comprehensive Multi-Agent Test Suite & E2E F…
utkarsh232005 Oct 16, 2026
2fde435
refactor(tests): eliminate code duplication in test_e2e_scenarios for…
utkarsh232005 Oct 16, 2026
3744976
Update agents/council.py
utkarsh232005 Oct 16, 2026
61fab13
Merge pull request #378 from utkarsh232005/feat/agents-phase20-multi-…
utkarsh232005 Oct 16, 2026
4fd9167
perf(agents): Phase 21 - Concurrency, Latency & Resource Tuning
utkarsh232005 Oct 17, 2026
785b395
fix(agents): address CodeRabbit review feedback on log clipping, conf…
utkarsh232005 Oct 17, 2026
fa8b5be
Merge pull request #379 from utkarsh232005/perf/agents-phase21-concur…
utkarsh232005 Oct 17, 2026
7f81bff
feat(agents): Phase 22 - Dynamic Multi-Model Strategy & Configuration
utkarsh232005 Oct 17, 2026
309d2e3
refactor(agents): decompose model resolution and config loading for C…
utkarsh232005 Oct 17, 2026
94f1867
Merge pull request #380 from utkarsh232005/feat/agents-phase22-dynami…
utkarsh232005 Oct 17, 2026
97c89da
feat(cli): Phase 23 - Feature Flags, Rollout Modes & Legacy Fallback
utkarsh232005 Oct 17, 2026
be1978c
test(ui): increase waitForFrame timeout to prevent flakiness under fu…
utkarsh232005 Oct 17, 2026
275030c
refactor(config): decompose config value parsers into table-driven fu…
utkarsh232005 Oct 17, 2026
b199051
test(ui): stabilize async progress event timing in analyze-dashboard …
utkarsh232005 Oct 17, 2026
b84aadd
Merge pull request #381 from utkarsh232005/feat/cli-phase23-feature-f…
utkarsh232005 Oct 17, 2026
2d48e35
feat(release): Phase 24 - Final System Architecture Integration & E2E…
utkarsh232005 Oct 17, 2026
bb8477c
refactor(test): decompose e2e lifecycle stages into focused units for…
utkarsh232005 Oct 17, 2026
601adb1
Merge pull request #382 from utkarsh232005/feat/release-phase24-final…
utkarsh232005 Oct 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
npx lint-staged
110 changes: 110 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/bin/sh

# Highly optimized pre-push hook for KDM CLI
# Ensures code quality, build integrity, and test coverage before commits are pushed to remote.

# Allow bypassing via environment variables if explicitly desired
if [ "${SKIP_PRE_PUSH}" = "1" ] || [ "${SKIP_HOOKS}" = "1" ]; then
echo "⏩ Skipping pre-push checks (SKIP_PRE_PUSH/SKIP_HOOKS enabled)"
exit 0
fi

z40="0000000000000000000000000000000000000000"

has_pushable_commits=0
run_ts_checks=0
run_py_checks=0

# Process standard input provided by git pre-push
# Input lines format: <local_ref> <local_sha> <remote_ref> <remote_sha>
while read -r local_ref local_sha remote_ref remote_sha; do
# If local ref is deleted (local_sha is all zeros), skip checks
if [ "$local_sha" = "$z40" ] || [ -z "$local_sha" ]; then
continue
fi

has_pushable_commits=1

# Check what files changed between remote and local ref
if [ "$remote_sha" = "$z40" ]; then
# Pushing a new branch: compare against origin/v4.0.0, origin/main, or HEAD~1
base_ref=""
if git rev-parse --verify origin/v4.0.0 >/dev/null 2>&1; then
base_ref="origin/v4.0.0"
elif git rev-parse --verify origin/main >/dev/null 2>&1; then
base_ref="origin/main"
elif git rev-parse --verify upstream/v4.0.0 >/dev/null 2>&1; then
base_ref="upstream/v4.0.0"
fi

if [ -n "$base_ref" ]; then
changed_files=$(git diff --name-only "$base_ref...$local_sha" 2>/dev/null || git diff --name-only HEAD~1 2>/dev/null)
else
changed_files=$(git diff --name-only HEAD~1 2>/dev/null)
fi
else
# Updating an existing branch: compare commits being pushed
changed_files=$(git diff --name-only "$remote_sha" "$local_sha" 2>/dev/null)
fi

# Fallback: if we cannot compute changed files, conservatively check everything
if [ -z "$changed_files" ]; then
run_ts_checks=1
run_py_checks=1
break
fi

# Check for TypeScript / CLI codebase changes
if echo "$changed_files" | grep -qE '^(src/|bin/|package\.json|tsconfig\.json|tsup\.config|\.lintstagedrc)'; then
run_ts_checks=1
fi

# Check for Python agent codebase changes
if echo "$changed_files" | grep -qE '^agents/'; then
run_py_checks=1
fi
done

# If no pushable commits (e.g. branch deletion), exit immediately
if [ "$has_pushable_commits" = "0" ]; then
exit 0
fi

# Optimization: If only non-code files changed (docs, markdown, yaml configs), skip heavy checks
if [ "$run_ts_checks" = "0" ] && [ "$run_py_checks" = "0" ]; then
echo "⚡ [pre-push] Only non-code/documentation changes detected. Skipping full build & test suite."
exit 0
fi

echo "🛡️ [pre-push] Running code quality verification before push..."

# TypeScript / CLI quality checks
if [ "$run_ts_checks" = "1" ]; then
echo "📦 [1/2] Verifying TypeScript build and type declaration generation..."
npm run build || {
echo "❌ [pre-push] Build failed ('npm run build'). Please fix compilation or type errors before pushing." >&2
exit 1
}

echo "🧪 [2/2] Running Vitest test suite..."
npm test || {
echo "❌ [pre-push] Unit tests failed ('npm test'). Please fix failing tests before pushing." >&2
exit 1
}
fi

# Python agent tests
if [ "$run_py_checks" = "1" ]; then
if command -v pytest >/dev/null 2>&1; then
echo "🐍 Running Python agent tests (pytest agents/)..."
pytest agents/ || {
echo "❌ [pre-push] Python agent tests failed ('pytest agents/'). Please fix agent tests before pushing." >&2
exit 1
}
else
echo "ℹ️ [pre-push] pytest not found in PATH; skipping Python agent test suite."
fi
fi

echo "✅ [pre-push] All automated code quality checks passed! Pushing to remote..."
exit 0
5 changes: 5 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
'src/**/*.{ts,tsx}': () => 'npm run check:types',
'src/__tests__/**/*.{test,spec}.{ts,tsx}': ['vitest run --pool=forks'],
'agents/**/*.py': ['python3 -m py_compile']
};
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ To set up your development environment:
```bash
npm install
```
*(This automatically initializes Husky Git hooks to ensure code quality standards on commit and push)*
3. To start the development watcher:
```bash
npm run dev
Expand Down
100 changes: 98 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Unlike tools that focus on a single runtime ([k9s] for Kubernetes or [lazydocker
| **Log Fetching** | Retrieve logs from containers or pods with automatic Docker-to-Kubernetes fallback |
| **Alert Notifications** | Send alerts via Discord webhook or email SMTP on failures |
| **Minikube Support** | Check Minikube profile status and connectivity |
| **Multi-Agent SRE** | Autonomous multi-agent council with local Ollama models, live Ink TUI, and closed-loop remediation (`kdm analyze --multi-agent`) |
| **AI Diagnostics** | Scan cluster workload configuration errors (`kdm analyze`) with AI explanations (`--explain`) |
| **AI Providers** | Multi-backend credentials (`kdm auth`) supporting OpenAI, Anthropic, Gemini, WatsonX, Ollama, etc. |
| **Local Cache** | Cache system (`kdm cache`) to save AI explanation API tokens and reduce network latency |
Expand Down Expand Up @@ -151,12 +152,102 @@ Scan your Kubernetes cluster for common workload issues (mismatched replicas, cr
```bash
kdm analyze # Run cluster diagnostics and output color-coded report
kdm analyze -n default # Analyze resources in the 'default' namespace only
kdm analyze --explain # Run diagnostics and fetch AI explanation
kdm analyze --multi-agent # Run autonomous multi-agent SRE council with local Ollama models
kdm analyze deployment/checkout-api --multi-agent # Target specific workload for multi-agent root-cause triaging
kdm analyze --explain # Run diagnostics and fetch single-prompt AI explanation
kdm analyze --explain --backend ollama # Force specific active AI backend provider
kdm analyze --explain --anonymize # Anonymize resource names in prompt to protect sensitive data
kdm analyze --output json # Output results in structured JSON format
```

### Multi-Agent SRE Architecture (`--multi-agent`)

KDM v4.0.0 features an autonomous **Multi-Agent SRE Council** running 100% locally via Ollama. Instead of relying on a single static LLM prompt, KDM coordinates domain-specialist agents in parallel to collect evidence, evaluate deterministic failure rules, correlate observations, formulate root-cause hypotheses, and safely apply verified remediations.

#### Complete Lifecycle Flow

```mermaid
flowchart TD
CLI["CLI Command: kdm analyze --multi-agent"] --> Collect["1. Evidence Collector\n(Pods, Events, Logs, Node Metrics)"]
Collect --> RuleEngine{"2. Deterministic Rule Engine\n(&lt; 5ms fast-path check)"}
RuleEngine -- Conclusive Match --> Instant["Instant Diagnosis\n(Zero LLM Overhead)"]
RuleEngine -- Complex Failure --> Council["Specialist Agent Council\n(Parallel Execution)"]

subgraph Specialists["2. Specialist Council"]
Council --> Runtime["Runtime & Log Agent\n(Exit codes, panic traces, crashes)"]
Council --> Config["Config & Dependency Agent\n(Limits, probes, secrets, ConfigMaps)"]
Council --> Resource["Cluster & Resource Agent\n(Node memory/disk pressure, capacity)"]
end

Runtime --> Correlate["3. Correlate & Validate\n(Lead SRE Synthesizer)"]
Config --> Correlate
Resource --> Correlate

Correlate --> Validator{"Cross-Agent Validator\n(Contradiction Check)"}
Validator -- Validated --> Consensus["4. Consensus Diagnosis\n(Root Cause + High Confidence + Solution)"]
Instant --> Consensus

Consensus --> TUI["Live Ink TUI Dashboard"]
TUI --> SafetyGate{"5. Remediation Safety Gate [y/N]\n(Destructive Command Policy)"}
SafetyGate -- "Confirmed [y]" --> Executor["Parameterized Executor\n(Stdout/Stderr + Audit Trail)"]
SafetyGate -- "Aborted [n]" --> Aborted["Remediation Aborted Safely"]

Executor --> Verify["6. Post-Fix Verification\n(Pod Ready 1/1, Rollout, Zero Restarts)"]
Verify --> Done["Remediation Successful!"]
```

#### Expected Product Flow

```text
$ kdm analyze deployment/checkout-api --multi-agent

1. COLLECT
✓ Kubernetes evidence collected (14 items)

2. INVESTIGATE
✓ Runtime Agent (detected exit code 137)
✓ Config Agent (checked limits and probes)
✓ Resource Agent (checked node memory pressure)

3. CORRELATE & VALIDATE
✓ Lead Investigator formulated root-cause hypothesis
✓ Validator confirmed: no contradictions

4. DIAGNOSIS
Root Cause: Container exceeded 256Mi memory limit under peak load
Confidence: HIGH · 96%

5. REMEDIATION
Action: Increase memory limit (256Mi → 512Mi)
Command: kubectl set resources deployment checkout-api --limits=memory=512Mi
Apply? [y/N]: y

6. VERIFY
✓ Deployment rolled out
✓ Pod Ready: 1/1
✓ No new restarts detected

Remediation successful.
```

#### CLI Flags & Configuration Options

| Option | Method | Description |
|--------|--------|-------------|
| `--multi-agent` | CLI Flag | Enables multi-agent council for `kdm analyze` |
| `--model <model>` | CLI Flag | Selects local Ollama model (e.g. `llama3.1`, `qwen2.5-coder`) |
| `multi_agent: true` | Config Store | Persist opt-in via `kdm config set multi_agent true` |
| `KDM_MULTI_AGENT=true` | Environment | Set environment variable for CI/CD or non-interactive automation |

#### Resilient 4-Step Graceful Degradation Ladder

KDM is engineered for mission-critical reliability. If local Ollama, Python, or cloud backends fail or timeout, KDM automatically falls back down the degradation ladder without throwing unhandled exceptions:

1. **Step 1: Multi-Agent Council** — Full parallel multi-agent triage with local Ollama models.
2. **Step 2: Deterministic Rule Engine** — Evaluates rules in `< 5ms` with zero LLM overhead for canonical failure signatures (`OOMKilled`, `CrashLoopBackOff`, `ImagePullBackOff`, `ProbeFailure`, `Scheduling`).
3. **Step 3: Legacy AI Client** — Single-prompt cloud provider completions (OpenAI, Claude, Azure).
4. **Step 4: Raw Kubernetes Summary** — Structured, formatted workload error diagnostics with zero AI required.

### AI Providers (Auth)

Manage AI backend settings and credentials. KDM supports **10+** AI providers including OpenAI, Anthropic, Gemini, Vertex, OCI GenAI, HuggingFace, Groq, WatsonX, and Ollama.
Expand Down Expand Up @@ -295,25 +386,30 @@ KDM automatically checks for failure conditions and sends notifications when con
| [Commander.js] | CLI framework and argument parsing |
| [dockerode] | Docker daemon API client |
| [@kubernetes/client-node] | Kubernetes API client |
| [Ink] + [React] | Interactive terminal UI (watch mode) |
| [Python 3] + [Ollama] | Multi-agent SRE council and local LLM execution |
| [Ink] + [React] | Interactive terminal UI (watch mode & council dashboard) |
| [chalk] | Terminal string coloring |
| [cli-table3] | Table rendering |
| [conf] | Persistent configuration |
| [nodemailer] | Email alerts |
| [tsup] | High-performance bundler |
| [Vitest] | Unit and end-to-end integration test runner |

[TypeScript]: https://www.typescriptlang.org
[Node.js]: https://nodejs.org
[Commander.js]: https://github.com/tj/commander.js
[dockerode]: https://github.com/apocas/dockerode
[@kubernetes/client-node]: https://github.com/kubernetes-client/javascript
[Python 3]: https://www.python.org
[Ollama]: https://ollama.com
[Ink]: https://github.com/vadimdemedes/ink
[React]: https://react.dev
[chalk]: https://github.com/chalk/chalk
[cli-table3]: https://github.com/cli-table/cli-table3
[conf]: https://github.com/sindresorhus/conf
[nodemailer]: https://nodemailer.com
[tsup]: https://tsup.egoist.dev
[Vitest]: https://vitest.dev

---

Expand Down
21 changes: 21 additions & 0 deletions agents/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
KDM Multi-Agent Collaborative Analysis System — v4.0.0
======================================================
"""

from __future__ import annotations

import os
import sys

_AGENTS_DIR = os.path.dirname(os.path.abspath(__file__))
if _AGENTS_DIR not in sys.path:
sys.path.insert(0, _AGENTS_DIR)

from council import AgentCouncil, resolve_model, run_council # noqa: E402

__all__ = [
"AgentCouncil",
"resolve_model",
"run_council",
]
8 changes: 8 additions & 0 deletions agents/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Pytest configuration for agents test suite."""

import os
import sys

_AGENTS_DIR = os.path.dirname(os.path.abspath(__file__))
if _AGENTS_DIR not in sys.path:
sys.path.insert(0, _AGENTS_DIR)
57 changes: 57 additions & 0 deletions agents/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"""
KDM Core Evidence Layer
=======================
Provides the canonical, normalized evidence model that forms the single
source of truth for all specialist agents and deterministic rules.

Core Architectural Rule: KDM collects facts; agents reason over facts.
"""

from .context import AnalysisContext, AnalysisMetadata
from .evidence import CollectionStatus, EvidenceBundle, EvidenceItem, Target
from .events import (
REQUIRED_CONSENSUS_KEYS,
VALID_AGENT_ROLES,
emit_agent_complete,
emit_agent_failed,
emit_agent_progress,
emit_agent_start,
emit_agent_tool_call,
emit_agent_tool_result,
emit_analysis_start,
emit_diagnosis_ready,
emit_error,
emit_event,
emit_evidence_collected,
emit_rule_matched,
)
from .sanitizer import redact_sensitive_data
from .store import EvidenceStore, FindingRecord, ToolCallRecord

__all__ = [
"AnalysisContext",
"AnalysisMetadata",
"CollectionStatus",
"EvidenceBundle",
"EvidenceItem",
"EvidenceStore",
"FindingRecord",
"REQUIRED_CONSENSUS_KEYS",
"Target",
"ToolCallRecord",
"VALID_AGENT_ROLES",
"emit_agent_complete",
"emit_agent_failed",
"emit_agent_progress",
"emit_agent_start",
"emit_agent_tool_call",
"emit_agent_tool_result",
"emit_analysis_start",
"emit_diagnosis_ready",
"emit_error",
"emit_event",
"emit_evidence_collected",
"emit_rule_matched",
"redact_sensitive_data",
]

Loading
Loading