diff --git a/docs/TORCH_EVOLUTION_CONCEPT.md b/docs/TORCH_EVOLUTION_CONCEPT.md new file mode 100644 index 0000000..5bd5eef --- /dev/null +++ b/docs/TORCH_EVOLUTION_CONCEPT.md @@ -0,0 +1,67 @@ +# TORCH Evolution: The Node-Based Future + +## 1. The Core Concept: From "Roster" to "Workflow" + +Currently, TORCH is a **Round-Robin Scheduler**. It loops through a static list of agents (`daily`/`weekly`). This is great for maintenance but limits complex, multi-step tasks. + +The "Bigger" vision is to evolve TORCH into a **Workflow Orchestrator** (similar to Airflow, Prefect, or ComfyUI, but for Autonomous Agents). + +### The Shift +* **Old**: `roster.json` (List) -> `Agent A`, `Agent B`, `Agent C`. +* **New**: `workflows/refactor.json` (Graph) -> `Trigger` -> `Planner` -> `[Coder, Writer]` -> `Reviewer`. + +## 2. The Node-Based UI + +You mentioned a "concept for a node based evolution". This is the right move. +* **Recommendation**: Build a web-based **Workflow Editor** using **React Flow** or **Svelte Flow**. +* **How it works**: + 1. **Drag & Drop Agents**: Drag a "Claude Node" or "Jules Node" onto the canvas. + 2. **Connect Context**: Draw lines to show data flow. Output of "Planner" becomes context for "Coder". + 3. **Visual Debugging**: Watch nodes light up Green/Red as the scheduler executes them in real-time. + +## 3. Tool Integrations + +Here is where the tools you mentioned fit in: + +### A. OpenClaw (The Interface / Gateway) +* **Role**: **The Conversational Trigger & Notification Layer**. +* **Why**: OpenClaw excels at connecting to Discord/Slack/Telegram. +* **Integration**: + * Don't make OpenClaw the *scheduler*. Make it the *interface*. + * You text OpenClaw: *"Run the 'Deep Refactor' workflow on `src/auth`."* + * OpenClaw triggers the TORCH backend and pipes updates back to your chat. + +### B. ClaudeCode CLI & Codex CLI (The Workers) +* **Role**: **Execution Nodes**. +* **Why**: Your local machine (Jules) can't be the only brain forever. +* **Integration**: + * Create specific "Nodes" in your graph for these tools. + * **"Claude Node"**: Wraps the `claude` CLI. Best for complex reasoning/architecture. + * **"Codex Node"**: Wraps the `codex` CLI. Best for pure code generation/completion. + * **"Local Node"**: Runs local models or scripts (what you do now). + +## 4. The Roadmap (How to get there) + +You don't need to do this alone. Here is a phased approach: + +**Phase 1: The Graph Data Structure (Backend)** +* Stop thinking in `roster.json`. Start thinking in `DAGs` (Directed Acyclic Graphs). +* Create a schema for a "Workflow" (e.g., inputs, steps, outputs). +* *Action*: I can help you draft this `workflow.schema.json`. + +**Phase 2: The "Headless" Runner** +* Modify `run-scheduler-cycle.mjs` to accept a `--workflow` argument instead of just looping a roster. +* It executes the graph: runs Node A, passes output to Node B. + +**Phase 3: The UI (The "Face")** +* Build a simple React/Next.js app that reads these JSON workflow files and renders them with React Flow. +* Allow editing and saving back to JSON. + +**Phase 4: The Integrations** +* Add "Nodes" for OpenClaw (notifications) and External CLIs (heavy lifting). + +## 5. Summary Opinion +Taking TORCH "node-based" transforms it from a **Janitor** (cleaning up code daily) into a **Factory** (building features on demand). + +* **Tools**: Use **React Flow** for UI. Use **OpenClaw** for ChatOps. +* **Strategy**: Keep the "Core" (locking/state) but replace the "Scheduler" (loop) with a "Runner" (graph). diff --git a/fix_prompts.py b/fix_prompts.py new file mode 100644 index 0000000..d0ff6a0 --- /dev/null +++ b/fix_prompts.py @@ -0,0 +1,68 @@ +import os +import re + +audit_file = "artifacts/prompt-safety-audit.md" + +with open(audit_file, "r") as f: + audit_data = f.read() + +agents = {} +blocks = audit_data.split("### ") +for block in blocks[1:]: + if "## Safe Prompts" in block: + block = block.split("## Safe Prompts")[0] + + lines = block.strip().split('\n') + if not lines: continue + agent_name = lines[0].strip() + if not agent_name: continue + + try: + issues_str = block.split("**Issues:**")[1].split("**Existing Safety Features:**")[0] + issues = [line.strip("- ").strip() for line in issues_str.strip().split('\n') if line.strip().startswith("- ")] + agents[agent_name] = issues + except: + pass + +def fix_agent(agent, issues): + path = None + for folder in ["daily", "weekly"]: + p = f"src/prompts/{folder}/{agent}.md" + if os.path.exists(p): + path = p + break + + if not path: + print(f"Could not find {agent}") + return + + with open(path, "r") as f: + content = f.read() + + missing_failure = any("Missing explicit FAILURE MODES" in i for i in issues) + missing_noop = any("no-op/stopping" in i for i in issues) + + if missing_failure and "FAILURE MODES" not in content: + failure_text = "\n\nFAILURE MODES\n- If preconditions are not met, stop.\n- If no changes are needed, do nothing.\n- If specific resources (files, URLs) are unavailable, log the error and skip.\n" + if "OUTPUTS\n" in content: + content = content.replace("OUTPUTS\n", failure_text + "\nOUTPUTS\n") + elif "OUTPUTS" in content: + content = content.replace("OUTPUTS", failure_text + "\nOUTPUTS") + else: + content += failure_text + + if missing_noop: + noop_text = "If no work is required, exit without making changes." + if "WORKFLOW" in content: + content = re.sub(r'(WORKFLOW.*?\n)', r'\1\n' + noop_text + '\n', content, count=1) + elif "MISSION" in content: + content = re.sub(r'(MISSION.*?\n)', r'\1\n' + noop_text + '\n', content, count=1) + else: + content = noop_text + "\n\n" + content + + with open(path, "w") as f: + f.write(content) + print(f"Fixed {agent}") + +for agent, issues in agents.items(): + fix_agent(agent, issues) diff --git a/landing/index.html b/landing/index.html index 074acc0..97d81f2 100644 --- a/landing/index.html +++ b/landing/index.html @@ -779,9 +779,9 @@
-

The Operating System for Your AI Workforce.

+

A Simple Round-Robin Agent Scheduler.

- A simple drag-and-drop folder that grants every project autonomous AI agents that learn, adapt, and evolve over time. + A lightweight, drop-in folder that rotates through autonomous agents to maintain and improve your codebase. No complex pipelinesβ€”just simple, effective orchestration.

Launch Dashboard @@ -793,15 +793,15 @@

Choose Your Agent

- + -
+
Codex Coming Soon @@ -809,12 +809,20 @@

Advanced reasoning for complex tasks.

-
+
- Claude - Coming Soon + Claude Code CLI + Active
-

Long-context understanding and safety.

+

Long-context understanding and safety. (CLI Required)

+
+ +
+
+ Antigravity IDE + Active +
+

The autonomous Python IDE.

@@ -866,7 +874,7 @@ npm install https://github.com/PR0M3TH3AN/TORCH/archive/refs/heads/main.tar.gz &
πŸ€–
-
Self-Evolving Agents
+
Adaptive Agents
Agents automatically adapt to your codebase and workflow patterns.
@@ -881,8 +889,8 @@ npm install https://github.com/PR0M3TH3AN/TORCH/archive/refs/heads/main.tar.gz &
🧠
-

Drop-in Divinity

-

Transform any LLM session into a project manager. Just paste a meta-prompt, and watch it coordinate tasks autonomously.

+

Drop-in Orchestration

+

Transform any LLM session into a productive workforce. Just paste a meta-prompt, and watch it coordinate tasks autonomously.

βœ…
@@ -902,14 +910,6 @@ npm install https://github.com/PR0M3TH3AN/TORCH/archive/refs/heads/main.tar.gz &
-
-

Functional Agents

-
- -

Loading agents...

-
-
-

Scheduler Meta Prompts

@@ -934,6 +934,14 @@ npm install https://github.com/PR0M3TH3AN/TORCH/archive/refs/heads/main.tar.gz &
+
+

Functional Agents

+
+ +

Loading agents...

+
+
+