[PR #15] [CLOSED] feat: Self-improvement infrastructure & user-collaborative validation framework #90

Closed
opened 2026-02-27 10:22:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/15
Author: @krzemienski
Created: 1/2/2026
Status: Closed

Base: mainHead: feat/agnostic-validation-gates


📝 Commits (8)

  • c366b52 chore: add Claude Flow and Swarm tooling directories to gitignore
  • 546d9e9 Enhance onboarding: MCP ecosystem integration & agent-assisted analysis
  • fdda7c7 feat(validation): Add agnostic validation gate framework
  • 4609211 feat(validation): Add opt-in user-collaborative validation system
  • a368f6b Clarify ClaudeAdapter settings inheritance comment
  • 4e838e6 refactor(self-improve): Pure-Python runner using SDK directly
  • 6b88f2f feat(self-improve): Add web UI and direct prompt file support
  • d83d7f5 feat(self-improve): Add full RalphConfig CLI params support

📊 Changes

17 files changed (+4776 additions, -4 deletions)

View changed files

📝 .gitignore (+10 -0)
examples/ralph-self-improvement.yml (+73 -0)
examples/run_self_improvement.py (+366 -0)
prompts/DIAGNOSTIC_PROMPT.md (+397 -0)
prompts/ONBOARDING_PROMPT.md (+820 -0)
prompts/VALIDATION_CODING_PROMPT.md (+349 -0)
prompts/VALIDATION_FEATURE_PROMPT.md (+504 -0)
prompts/VALIDATION_PROPOSAL_PROMPT.md (+185 -0)
📝 ralph.yml (+19 -1)
scripts/self_improve.py (+487 -0)
📝 src/ralph_orchestrator/orchestrator.py (+125 -2)
src/ralph_orchestrator/validation/__init__.py (+48 -0)
src/ralph_orchestrator/validation/base.py (+253 -0)
src/ralph_orchestrator/validation/config.py (+253 -0)
src/ralph_orchestrator/validation/gates.py (+538 -0)
📝 tests/test_acp_client.py (+2 -1)
tests/test_validation_feature.py (+347 -0)

📄 Description

Summary

This PR adds two foundational capabilities to Ralph Orchestrator:

1. Self-Improvement Infrastructure (scripts/self_improve.py)

A pure-Python runner that enables AI to improve AI - Ralph can now build features into itself:

# Run with any prompt file
python scripts/self_improve.py -P prompts/MY_FEATURE_PROMPT.md

# With web monitoring dashboard
python scripts/self_improve.py -P prompts/PROMPT.md --with-web-ui

Key features:

  • Uses Ralph's Python API directly (no CLI subprocess)
  • Full RalphConfig parameter support via CLI
  • Inherits user's Claude Code settings (MCP servers, tools)
  • Web UI monitoring with --with-web-ui
  • Optimized defaults: 200k context window, 95% threshold

2. User-Collaborative Validation Framework

An opt-in validation system where AI proposes validation strategies and users confirm before proceeding:

Philosophy: Propose, Don't Prescribe

  • AI analyzes project and drafts validation proposal
  • User confirms, modifies, or declines
  • No auto-generated configs or hardcoded MCP mappings
  • Leverages user's existing Claude Code MCP servers

Usage:

orchestrator = RalphOrchestrator(
    prompt_file="PROMPT.md",
    enable_validation=True,      # Opt-in
    validation_interactive=True,  # User confirmation required
)

Why This Approach?

The self-improvement infrastructure enables a development pattern where:

  1. Write a prompt describing a feature
  2. Run self_improve.py with that prompt
  3. Ralph builds the feature into itself

This PR is the foundation. Subsequent features (TUI, onboarding, etc.) will be built using this self-improvement system.

Files Changed

  • scripts/self_improve.py - Pure Python self-improvement runner
  • src/ralph_orchestrator/validation/ - Validation framework
  • src/ralph_orchestrator/orchestrator.py - enable_validation support
  • prompts/VALIDATION_*.md - Validation prompts
  • tests/test_validation_feature.py - Test suite (16 tests passing)

Test Plan

  • python scripts/self_improve.py --status works
  • python scripts/self_improve.py --help shows all params
  • Orchestrator creation with RalphConfig works
  • All 16 validation tests pass
  • Run self-improvement with validation feature prompt

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mikeyobrien/ralph-orchestrator/pull/15 **Author:** [@krzemienski](https://github.com/krzemienski) **Created:** 1/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/agnostic-validation-gates` --- ### 📝 Commits (8) - [`c366b52`](https://github.com/mikeyobrien/ralph-orchestrator/commit/c366b52e9ce79c9ef74aa8fde5e676f21865a945) chore: add Claude Flow and Swarm tooling directories to gitignore - [`546d9e9`](https://github.com/mikeyobrien/ralph-orchestrator/commit/546d9e989f6dec93a60c7e64ad19fe7b2ce3119d) Enhance onboarding: MCP ecosystem integration & agent-assisted analysis - [`fdda7c7`](https://github.com/mikeyobrien/ralph-orchestrator/commit/fdda7c72d26ac40147919314b3165a9e050342c8) feat(validation): Add agnostic validation gate framework - [`4609211`](https://github.com/mikeyobrien/ralph-orchestrator/commit/46092114e7a84ab3ecb63d902462e930666a6eeb) feat(validation): Add opt-in user-collaborative validation system - [`a368f6b`](https://github.com/mikeyobrien/ralph-orchestrator/commit/a368f6b00e21a5e5a968be44ca8be378ddd9cbbf) Clarify ClaudeAdapter settings inheritance comment - [`4e838e6`](https://github.com/mikeyobrien/ralph-orchestrator/commit/4e838e6f0c45597e21e5660723b0932a9ab8ec72) refactor(self-improve): Pure-Python runner using SDK directly - [`6b88f2f`](https://github.com/mikeyobrien/ralph-orchestrator/commit/6b88f2fc3250a4337b61c8d9db9cf6d02fb153e4) feat(self-improve): Add web UI and direct prompt file support - [`d83d7f5`](https://github.com/mikeyobrien/ralph-orchestrator/commit/d83d7f51774e0b97518990c39ed05e119af4b48c) feat(self-improve): Add full RalphConfig CLI params support ### 📊 Changes **17 files changed** (+4776 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+10 -0) ➕ `examples/ralph-self-improvement.yml` (+73 -0) ➕ `examples/run_self_improvement.py` (+366 -0) ➕ `prompts/DIAGNOSTIC_PROMPT.md` (+397 -0) ➕ `prompts/ONBOARDING_PROMPT.md` (+820 -0) ➕ `prompts/VALIDATION_CODING_PROMPT.md` (+349 -0) ➕ `prompts/VALIDATION_FEATURE_PROMPT.md` (+504 -0) ➕ `prompts/VALIDATION_PROPOSAL_PROMPT.md` (+185 -0) 📝 `ralph.yml` (+19 -1) ➕ `scripts/self_improve.py` (+487 -0) 📝 `src/ralph_orchestrator/orchestrator.py` (+125 -2) ➕ `src/ralph_orchestrator/validation/__init__.py` (+48 -0) ➕ `src/ralph_orchestrator/validation/base.py` (+253 -0) ➕ `src/ralph_orchestrator/validation/config.py` (+253 -0) ➕ `src/ralph_orchestrator/validation/gates.py` (+538 -0) 📝 `tests/test_acp_client.py` (+2 -1) ➕ `tests/test_validation_feature.py` (+347 -0) </details> ### 📄 Description ## Summary This PR adds two foundational capabilities to Ralph Orchestrator: ### 1. Self-Improvement Infrastructure (`scripts/self_improve.py`) A pure-Python runner that enables **AI to improve AI** - Ralph can now build features into itself: ```bash # Run with any prompt file python scripts/self_improve.py -P prompts/MY_FEATURE_PROMPT.md # With web monitoring dashboard python scripts/self_improve.py -P prompts/PROMPT.md --with-web-ui ``` **Key features:** - Uses Ralph's Python API directly (no CLI subprocess) - Full RalphConfig parameter support via CLI - Inherits user's Claude Code settings (MCP servers, tools) - Web UI monitoring with `--with-web-ui` - Optimized defaults: 200k context window, 95% threshold ### 2. User-Collaborative Validation Framework An **opt-in** validation system where AI proposes validation strategies and users confirm before proceeding: **Philosophy: Propose, Don't Prescribe** - AI analyzes project and drafts validation proposal - User confirms, modifies, or declines - No auto-generated configs or hardcoded MCP mappings - Leverages user's existing Claude Code MCP servers **Usage:** ```python orchestrator = RalphOrchestrator( prompt_file="PROMPT.md", enable_validation=True, # Opt-in validation_interactive=True, # User confirmation required ) ``` ## Why This Approach? The self-improvement infrastructure enables a development pattern where: 1. Write a prompt describing a feature 2. Run `self_improve.py` with that prompt 3. Ralph builds the feature into itself This PR is the foundation. Subsequent features (TUI, onboarding, etc.) will be built using this self-improvement system. ## Files Changed - `scripts/self_improve.py` - Pure Python self-improvement runner - `src/ralph_orchestrator/validation/` - Validation framework - `src/ralph_orchestrator/orchestrator.py` - `enable_validation` support - `prompts/VALIDATION_*.md` - Validation prompts - `tests/test_validation_feature.py` - Test suite (16 tests passing) ## Test Plan - [x] `python scripts/self_improve.py --status` works - [x] `python scripts/self_improve.py --help` shows all params - [x] Orchestrator creation with RalphConfig works - [x] All 16 validation tests pass - [ ] Run self-improvement with validation feature prompt --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 10:22:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ralph-orchestrator#90
No description provided.