| name | triple-loop-learning |
| plugin | agent-loops |
| description | (Industry standard: Meta-Learning System / Automated Autoresearch) Primary Use Case: Continuous, self-improving orchestration of an agentic system over multiple sessions. Use when: building a continuous improvement layer that autonomously identifies workflow friction, postulates hypotheses, and tests improved instructions/coding skills against an objective headless benchmark before merging and persisting. |
| allowed-tools | Bash, Read, Write |
Dependencies
This skill requires Python 3.8+ and standard library only.
Evaluation gate: NOT included in this primitive. The calling system (e.g., agent-agentic-os
os-improvement-loop) is responsible for wrapping this skill with an eval gate and experiment log.
Triple-Loop Learning (Meta-Learning System)
This skill defines the orchestration pattern for the Triple-Loop Architecture. Pattern 5 is a robust, autonomous feedback loop where an independent Meta-Learning Orchestrator governs a long-horizon pipeline of execution, planning, and tactical problem-solving.
This architecture is entirely framework-agnostic. While originally developed for agent-agentic-os, it models the core loop defined by Meta-Harness research where autonomous systems evolve their own operating instructions based strictly on headless evaluators.
Architecture Overview
flowchart TD
subgraph Outer["Outer Loop (Meta-Learning & Orchestration)"]
Hypothesize[Hypothesis Generation] --> StrategyBridge[Strategy Packet]
Report --> EvalBridge[Score Analysis]
EvalBridge --> Conclude[Accept / Reject Hypothesis]
end
subgraph Mid["Strategic Planner (Dual-Loop Integration)"]
Plan[Define Sub-tasks] --> TacticalBridge[Handoff Packet]
Result[Aggregate Results] --> Report[Generate Report]
end
subgraph Inner["Tactical Executor (Single-Loop Integration)"]
Execute[Code Mutation] --> Test[Headless Evaluation]
Test --> ResultBridge[Pass/Fail Signal]
end
StrategyBridge --> Plan
TacticalBridge --> Execute
ResultBridge --> Result
The Workflow Protocol
Step 1: Friction Aggregation (Outer Loop)
- The Orchestrator constantly ingests execution logs from existing operations. Look for repeated uncertainties, API errors, test failures, or syntax flaws.
- Group the friction into clustered tasks.
Step 2: Hypothesis Generation (Outer Loop)
- Define a singular thesis: "If we change instruction X, the accuracy score on benchmark Y will improve by N."
- Write a rigid Strategy Packet for the Mid-level Planner.
Step 3: Distribution (Strategic Planner)
- Interactively Determine CLI and Model (ask once during bootstrap): Interactively prompt the user to select the CLI backend (
agy, claude, copilot, etc.) and the specific model to run mutations and evaluation.
- The Planner assigns disjoint code fixes to one or multiple Tactical Executors using the selected CLI and model.
- Ensure test boundaries and standard input redirection (appending
< /dev/null to commands) are defined to prevent SIGTTIN process freezes.
Step 4: Mutation & Headless Scoring (Tactical Executor)
Constraint: Subjective LLM analysis is expressly prohibited.
- Apply the instruction set or code adjustment.
- Run pure, headless deterministic tests. Return an objective integer/float score, not opinions.
Step 5: Verification & Promotion (Outer Loop - Trust But Verify)
- Read the objective score differentials. No blind trust is allowed.
- TDD / Test Check: The promotion logic MUST be backed by headless evaluation. Run the full regression test suite on mutated code.
- Delta Inspection: Check the source diffs for any stub placeholders ("TODO", "TBD", "[NEEDS INPUT]") and verify syntax cleanliness.
- KEEP only if Accuracy AND F1 score pass the current baseline. Reject otherwise.
- Postulate a retrospective mapping for continuous system-wide instructions improvement.