Meta-Optimize: Outer-Loop Harness Optimization for ARIS
Before each reviewer slot, follow Selectable Reviewers:
resolve invocation →
.aris/reviewer.json→ Codex default (fresh native reviewer)
with
reviewer_route.pythrough the canonical helper resolver, preserving this
slot's tier, fresh contexts, source/image inputs and deterministic gates.
Codex examples/pins below apply only to
backend=codex; other routes use their
own first-call/reply contract. Save the route and actual returned identity;
unavailable selections are
REVIEW_UNAVAILABLE. Classify acceptance from actual
families/completion/scope. Forward invocation reviewer/model/effort overrides
to reviewer-bearing children. Generation workers are unchanged.
Analyze accumulated usage logs and propose optimizations for: $ARGUMENTS
Context
ARIS is a research harness — a system of skills, bridges, workflows, and artifact contracts that wraps around LLMs to orchestrate research. This skill implements a prototype outer loop that observes how the harness is used and proposes improvements to the harness itself (not to the research artifacts it produces).
Inspired by Meta-Harness (Lee et al., 2026): the key insight is that harness design matters as much as model weights, and harness engineering can be partially automated by logging execution traces and using them to guide improvements.
What This Skill Optimizes (Harness Components)
| Component | Example | Optimizable? |
|-----------|---------|:---:|
| SKILL.md prompts | Reviewer instructions, quality gates, step descriptions | Yes |
| Default parameters | difficulty: medium, MAX_ROUNDS: 4, threshold: 6/10 | Yes |
| Convergence rules | When to stop the review loop, retry counts | Yes |
| Workflow ordering | Skill chain sequence within a workflow | Yes |
| Artifact schemas | What fields go in EXPERIMENT_LOG.md, idea-stage/IDEA_REPORT.md | Cautious |
| MCP bridge config | Which reviewer model, routing rules | No (infra) |
Not optimized: The research artifacts themselves (papers, code, experiments). That's what the regular workflows do.
Prerequisites
- Logging must be active. Codex mirror installs do not create Claude Code hooks. Provide
.aris/meta/events.jsonlfrom a Codex-compatible event logger, an external wrapper, or a manually exported trace log before running this skill. - Sufficient data. At least 5 complete workflow runs logged in
.aris/meta/events.jsonl. The skill will check and warn if insufficient.
Workflow
Step 0: Check Data Availability
EVENTS_FILE=".aris/meta/events.jsonl"
if [ ! -f "$EVENTS_FILE" ]; then
echo "ERROR: No event log found at $EVENTS_FILE"
echo "Enable Codex-compatible logging first: create .aris/meta/events.jsonl from your Codex wrapper, external event logger, or exported trace log."
exit 1
fi
EVENT_COUNT=$(wc -l < "$EVENTS_FILE")
SKILL_INVOCATIONS=$(grep -c '"skill_invoke"' "$EVENTS_FILE" || echo 0)
SESSIONS=$(grep -c '"session_start"' "$EVENTS_FILE" || echo 0)
echo "📊 Event log: $EVENT_COUNT events, $SKILL_INVOCATIONS skill invocations, $SESSIONS sessions"
if [ "$SKILL_INVOCATIONS" -lt 5 ]; then
echo "⚠️ Insufficient data (<5 skill invocations). Continue using ARIS normally and re-run later."
exit 0
fi
Step 1: Analyze Usage Patterns
Read .aris/meta/events.jsonl and compute:
Frequency analysis:
- Which skills are invoked most often?
- Which slash commands do users type most?
- What parameter overrides are most common? (These suggest bad defaults.)
Failure analysis:
- Which tools fail most often? In which skills?
- What error patterns repeat? (OOM, import, compilation, timeout)
- How many auto-debug retries per workflow run?
Convergence analysis (for auto-review-loop):
- Average rounds to reach threshold
- Score trajectory shape (fast improvement? plateau? oscillation?)
- Which review round catches the most critical issues?
- Do users override difficulty mid-run?
Human intervention analysis:
- Where do users interrupt with manual prompts during workflows?
- What manual corrections do users make most? (These indicate skill gaps.)
Model-delta analysis (harness diet):
- Has the session model or the pinned reviewer model changed since a skill's
SKILL.md was last touched? A model bump is a **trigger to re-read, not
evidence by itself**: a deletion proposal must cite TARGET-SPECIFIC evidence
(a capability-specific release note, or repeated post-bump event-log behavior
showing the scaffold is unused). Never deletion candidates: privilege
boundaries, acceptance/review gates, corpus/provenance rules, output
contracts, safety checks. The diet targets model-compensation scaffolding
only — a capability the new model has natively is pure overhead. A harness
that only ever grows is a harness nobody is re-reading.
Trigger-rate analysis (measured, not from the event log): the log shows
which skills were USED, not which were WANTED-but-omitted. Mainline ships
tools/meta_opt/trigger_eval.py, which measures Claude Code's skill triggering
via claude -p probes (trigger / confusion / miss). It is Claude-Code-specific
— there is no equivalent codex skill-selection probe yet, so for a Codex
executor treat trigger-rate as a mainline signal, not a step you run here.
Measure-only regardless: a low rate is INPUT to a proposal, never a self-applied
rewrite; the confusion matrix (which sibling a query lands on) points at
disambiguation, not "make it pushier".
Present findings as a structured summary table.
Step 1.5: Name the Current Bottleneck
Synthesize the Step-1 analyses into **one sentence naming the single
most-limiting pipeline stage right now** — e.g. "planning", "verification
quality", "experiment execution reliability", "writing polish" — with evidence.
The bottleneck always moves: coding → planning → verification → taste. Step 2's
ranked table should read as sub-fixes for this one named constraint.
Append the verdict to the append-only ledger .aris/meta/bottleneck_log.jsonl
(never edit or delete prior lines — succession history is the point):
mkdir -p .aris/meta
# json.dumps, NOT hand-interpolated shell strings: bottleneck/evidence are
# natural language — a stray quote must not break the JSONL (or the shell).
python3 - <<'PY'
import json, datetime
entry = {
"ts": datetime.datetime.now().astimezone().isoformat(timespec="seconds"),
"cycle": 3,
"bottleneck": "verification quality",
"evidence": "review rounds plateau at 6/10 while tool failures are rare",
"top_patch_ids": ["P1", "P2"],
}
with open(".aris/meta/bottleneck_log.jsonl", "a", encoding="utf-8") as fh:
fh.write(json.dumps(entry, ensure_ascii=False) + "\n")
PY
On the next run, read the last line first and open the report by stating
whether that bottleneck was resolved and what it has moved to.
Step 2: Identify Optimization Targets
Based on Step 1, rank optimization opportunities by expected impact:
## Optimization Opportunities (ranked)
| # | Target | Signal | Proposed Change | Expected Impact |
|---|--------|--------|-----------------|-----------------|
| 1 | auto-review-loop default threshold | Users override to 7/10 in 60% of runs | Change default from 6/10 to 7/10 | Fewer manual overrides |
| 2 | experiment-bridge retry count | 40% of runs hit max retries on OOM | Add OOM-specific recovery (reduce batch size) | Fewer failed experiments |
| 3 | paper-write de-AI patterns | Users manually fix "delve" in 80% of runs | Add "delve" to default watchword list | Fewer manual edits |
| 4 | experiment-bridge Phase-2 hand-holding steps | Model bump; scaffold untouched for 2 generations; zero failures in the guarded steps | **DELETE steps N–M — the new model does this unprompted** | Smaller harness, less drift surface |
The Proposed-Change column is explicitly allowed to be a deletion — "DELETE
step N, new model does this for free" is a first-class optimization.
If $ARGUMENTS specifies a target skill, focus analysis on that skill only.
If $ARGUMENTS is empty or "all", analyze all skills with sufficient data.
Step 3: Generate Patch Proposals
For each optimization target, generate a concrete diff:
--- a/skills/auto-review-loop/SKILL.md
+++ b/skills/auto-review-loop/SKILL.md
@@ -15,7 +15,7 @@
## Constants
-- **SCORE_THRESHOLD = 6** — Minimum review score to accept.
+- **SCORE_THRESHOLD = 7** — Minimum review score to accept. (Raised based on usage data: 60% of users overrode to 7+.)
Rules for patch generation:
- One patch per optimization target
- Each patch must include a comment explaining WHY (with data from the log)
- Patches must be minimal — change only what the data supports
- Never change artifact schemas or MCP bridge config in v1
- Never change behavior that would break existing user workflows
- Anti-self-poisoning screen: resolve
$ARIS_REPOfrom
.aris/installed-skills-codex.txt, then run
$ARIS_REPO/tools/capture_filter.py (or project-local
tools/capture_filter.py) against each proposed patch rationale. If it flags
an environment failure, transient error, negative tool-capability claim, or
one-off narrative, rewrite the proposal to the fix/config/workaround or drop
it. Warn-and-skip only when the helper cannot be resolved. See