agentleFS
IgorGanapolskyIgorGanapolsky/ThumbGate/.agents/skills/multi-harness-rl-invariants/SKILL.md

multi-harness-rl-invariants

Skill29 starsChanged 7 months agoMITView on GitHub

Cross-harness RL invariant engine stolen from Hugging Face FineEnvs (multi-harness-rl). Normalizes tool invocations across Claude Code, Antigravity, Strands, and OpenHands, catches catastrophic format failures, and computes cross-harness transfer reward signals.

  • Deletes or force-pushes
  • Commits and pushes
Files
SKILL.md

Multi-Harness RL Invariants — Cross-Harness Generalization

The Research Finding (FineEnvs / Orchard 2026)

Models trained inside a single agent harness (e.g. OpenHands or Claude Code) experience severe performance drops when deployed to a foreign harness:

  • Catastrophic Format Failure: Models hallucinate parameters, emit broken JSON, or fail to parse shell tool outputs when moving to another harness.
  • Degraded Resolve Rate: OpenSWE-32B drops 58.8 points (from 62.4% down to 3.6%) when transferring to Kimi-CLI.
  • Harness Overfitting: Swapping the harness moves benchmark resolve rates by up to 13 points, while swapping the underlying model moves scores by only 2.5 to 5 points.

The ThumbGate Architecture

ThumbGate acts as the universal Canonical Action Normalizer & Invariant Gateway:

[Claude Code] ──┐
[Antigravity] ──┼─► [Canonical Action Quadruplet] ──► [Cross-Harness Invariant Diode] ──► [Target System]
[Strands]     ──┤    (entity, op, target, params)     (Format, Security, Bounds)
[OpenHands]   ──┘

1. Canonical Action Quadruplets

Regardless of the model's originating harness, every action is normalized into:

  • harness: Source harness (claude_code, antigravity, strands, openhands, terminus)
  • domain: shell, filesystem, network, generic
  • operation: exec, read, write, delete
  • target: Command line string, file path, or URL
  • payload: Contextual arguments

2. Format & Safety Invariant Gates

  • Prevents command injection and forbidden operations (rm -rf /, git push --force origin main, gh pr merge --admin).
  • Blocks path traversal (../../../etc/passwd).
  • Evaluates before any execution occurs.

3. Transfer Scorecard & RL Rewards

Calculates multi-harness diversity multipliers and invariant pass rates for RL / DPO model training:

node scripts/strands-box-doctor.js --json

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.