WikifitaGitHub live67e8de5
outro · co-fita/co-fita-research-operations

Co-Fita Research Operations

How research is conducted: the AutoResearch protocol for long-horizon autonomous tasks, the web research pipeline (SearXNG + Crawl4AI), the Hyper Harness orchestrator, and the operational methodology.

Baixar raw

Co-Fita Research Operations

How research is conducted within the Co-Fita ecosystem. Three layers: the AutoResearch protocol for autonomous long-horizon tasks, the web research pipeline (SearXNG + Crawl4AI) for information gathering, and the Hyper Harness orchestrator that ties everything together.

The methodology is shaped by a core observation: long-running code agents fail not from insufficient model capability, but from missing engineering scaffolding. Cognitive loops, stalls, and runtime fragility are engineering problems with engineering solutions.

See also: co-fita-infrastructure | unit-distance-methodology | co-fita-pam-setup


1. The Three Layers

┌─────────────────────────────────────────────────┐
│           Layer 3: AutoResearch Protocol          │
│  (Long-horizon task execution, stall detection)  │
├─────────────────────────────────────────────────┤
│           Layer 2: Hyper Harness Orchestrator     │
│  (Phase loop, governance, red team, elo arena)   │
├─────────────────────────────────────────────────┤
│           Layer 1: Web Research Pipeline          │
│  (SearXNG search + Crawl4AI deep reading)        │
└─────────────────────────────────────────────────┘

Each layer operates independently and can be used without the others. AutoResearch works on any task. The Harness orchestrates multi-step research. The Pipeline provides raw information.


2. AutoResearch Protocol (Deli_AutoResearch)

A protocol framework for long-horizon autonomous tasks (days to weeks). Ships no executable code -- it prescribes conventions for state management, stall detection, guardian layering, and behavioral constraints.

The Three Failure Modes

Failure ModeDescriptionFrequency
Cognitive loopSuccessive iterations try similar directions with diminishing returns; unable to escape a local optimumCommon
StallingAgent finishes work, outputs summary, waits for user feedback. Session looks alive, but work has stoppedMore common than crashes
Runtime fragilityContext compaction silently breaks the loop; closing a session takes down parasitic timersRare but catastrophic

The common cause: missing engineering scaffolding, not insufficient model capability.

Behavioral Constraints (Non-Negotiable)

  1. Zero interaction -- no prompting the user during a run. No Plan Mode, no question tool, no ending on a question. Continue working until the user stops you. Resolve ambiguity yourself and write the reasoning to the log.

  2. Ready means execute -- the most common hidden violation: finishing all preparation and then asking "should I submit?". The purpose of preparation is execution.

  3. Callback means report-alive -- after context compaction the loop dies silently. The first action of every callback updates its own last_seen, then checks liveness; on detecting failure it restarts immediately.

  4. Persist state to files -- all progress is written to state/ files, not conversation memory. Each iteration starts a fresh session, injecting only curated state; never use resume.

  5. Guardian / worker separation -- a heartbeat patrol may take only three actions on tasks that are not its own: liveness-check, restart, nudge. It does not read their data, modify their state files, or report to the user on their behalf.

State File Structure

{task}/state/
├── task_spec.md           # goal / milestones / success criteria
├── progress.json          # {iteration, total_findings, status, stale_count}
├── findings.jsonl         # accumulated findings (append-only)
├── directions_tried.json  # directions already tried
└── iteration_log.jsonl    # per-iteration summary

{task}/logs/
├── work.jsonl             # written by work agent
├── orchestrator.jsonl     # written by orchestrator
└── heartbeat.jsonl        # written by heartbeat watchdog

Stall Detection and Pivoting

MechanismRule
Stall detectionAn iteration with 0 new findings or a metric drop increments stale_count
Forced pivotstale_count >= 2 -- change a structural constraint, not tactical parameters
Direction diversityA new direction must differ from every tried one
Round capA single work session caps at 15 rounds or 30 minutes

The key insight: "Pivot structure, not tactics." When a task stalls repeatedly within a frame, the gain usually comes from correcting the environment or structural constraint, not from tuning strategy parameters harder inside the existing frame.

Heartbeat Watchdog (Three-Layer V3)

LayerFormDepends onRole
L0Resident shell guardNo sessionHeartbeat stale > 2h -- spin up emergency patrol via headless agent
L1Durable cron, hourlyA living interactive sessionCheck each loop's last_seen, restart timed-out loops, detect stalling
L2Business loopEach its own sessionFirst line of each callback updates its own last_seen

Any one layer dying can be detected and recovered by another. This is defense in depth for agent reliability.

Subagent Scheduling Patterns

PatternUseKey Idea
A Goal-drivenResearch iterationInject tried directions, require verifiable findings, write back to findings.jsonl
B Parallel explorationComplex sub-problemsFire multiple agents in one message: investigation, refutation, cross-domain analogy
C Experiment runLong compute jobsStart minute-level polling right after submit: auto-diagnose errors, fix, resubmit
D VerificationPost-iteration QAAn independent subagent audits the evidence chain of findings

Validated Output

The framework has been validated on academic paper writing:

PaperPagesCitationsSelf-rated
Autonomous Research Agents592288.0/10
Continual Learning653268.0/10
Long-Horizon Decision-Making553848.0/10
Self-Play (285B RL experiment)752178.6/10

The longest continuous run on record: 72 hours, 6 directional human inputs, zero operational intervention.


3. Hyper Harness Orchestrator (v3.0)

The orchestrator manages multi-phase research cycles. Each phase maps to a specific type of work.

The Five Phases

I.   Ideation    -- SearXNG + Crawl4AI + OpenCode generate hypotheses
II.  Execution   -- OpenCode executes the best approach
III. Audit       -- Red Team adversarial verification
IV.  Fixation    -- HashMath cryptographic anchoring
V.   Governance  -- Proposals from failures, Congress every N=3 iterations,
                     Kanban escalation, Telegram notifications,
                     wiki export (wiki, elo-arena, failure-tree)

Module Registry

The orchestrator integrates these modules:

ModulePurpose
Plugin RegistryOpen-Closed extension system
ACP ClientSingle model gateway (OpenCode)
SearXNGPrivacy-respecting web search
Crawl4AIDeep reading and page extraction
Failure TreeBranch/fail/explore tracking
ReflectorVerbal reinforcement for improving outputs
Elo ConsolidatorTournament-style ranking of findings
Red Team ArenaAdversarial audit of results
HashMathCryptographic anchoring of findings
Telegram GatewayOuter loop notifications
WatchdogStall detection and recovery
GovernancePhase V -- Centralismo Democratico

Architecture Principle

All model inference flows through a single path:

Orchestrator → ACP Client → OpenCode → mlx-lm / vllm-mlx (localhost:8080)

The harness orchestrates WHAT to ask, not HOW to serve. This separation means the entire serving layer can be swapped without changing orchestration logic.


4. Web Research Pipeline

The information gathering layer, combining SearXNG for broad search with Crawl4AI for deep reading.

SearXNG

A privacy-respecting metasearch engine running locally in Docker. It aggregates results from multiple search engines without forwarding user data.

  • Endpoint: http://searxng:8080 (within Docker) or localhost:8080 (from host)
  • Configuration: Environment variable SEARXNG_INSTANCE
  • Use case: Broad hypothesis generation, finding relevant papers, discovering infrastructure details

Crawl4AI

A web scraping tool designed for AI research pipelines. It extracts clean, readable content from web pages.

  • Use case: Deep reading of papers, documentation, and technical articles discovered by SearXNG
  • Integration: Called by the orchestrator during Phase I (Ideation)

Pipeline Flow

Research Question
    → SearXNG (broad search, multiple engines)
    → Crawl4AI (deep read top results)
    → OpenCode (analyze and synthesize)
    → Findings (appended to findings.jsonl)

5. Elo Arena and Failure Tree

Two tracking mechanisms that provide quantitative feedback on research quality.

Elo Arena

A tournament-style ranking system for hypotheses, findings, and approaches. Each finding competes against others; the Elo rating reflects its quality relative to the corpus.

Use in practice: The ClickFix investigation used Elo ratings to track the quality of different forensic analyses and infrastructure assessments. The unit distance research used Elo to rank hypotheses (H4 at Elo 1500, H15 at Elo 2200, H16 at Elo 2350).

Failure Tree

A structured tracking system for failed approaches. Each failure is categorized, and the tree accumulates patterns that inform future pivots.

Categories:

  • methodological -- wrong approach, insufficient data
  • technical -- implementation bugs, environment issues
  • conceptual -- flawed assumptions, misunderstanding of the problem

The failure tree prevents the cognitive loop failure mode by forcing the system to recognize when a direction has been exhausted.


6. Operational Methodology

How a Research Session Works

  1. Initialization -- the user provides a research question or task specification
  2. State setup -- state/task_spec.md is written with goals, milestones, and success criteria
  3. Orchestrator starts -- the phase loop begins, running Ideation → Execution → Audit → Fixation → Governance
  4. Work agents are spawned -- each iteration starts a fresh session with injected state (never resume)
  5. Stall detection -- the watchdog monitors progress; if stale_count >= 2, a structural pivot is forced
  6. Results are anchored -- HashMath provides cryptographic fixation of findings
  7. Governance -- every N=3 iterations, a Congress reviews accumulated findings and proposes direction changes
  8. Wiki export -- findings are published to the wikifita knowledge base

Anti-Contamination Protocol

For sensitive research (like the unit distance conjecture), additional constraints apply:

  • No access to external solutions or benchmarks
  • Web searches are blocked for specific values or papers
  • Findings are validated against the original source materials only
  • Enforcement via PreToolUse hooks on WebSearch and Bash tools

Quality Standards

  • All scripts: #!/bin/bash with set -euo pipefail
  • State persisted to files, not conversation memory
  • Fresh sessions over resume (context accumulation causes cognitive loops)
  • Citation-like content verified every 20 entries, never batched
  • Unresolvable external-dependency failures escalate; never abandon silently

7. Connection to Other Co-Fita Components

ComponentRelationship
co-fita-infrastructureThe infrastructure layer provides the Docker stack, dashboard, and LLM backend that the research operations run on
co-fita-pam-setupPAM setup ensures Touch ID works in all terminal contexts, including the tmux sessions where long-running agents operate
co-fita-clickfix-vaccineThe ClickFix investigation was one of the first operational uses of the research pipeline (SearXNG for infrastructure analysis, Crawl4AI for deep reading of blockchain explorers)
clickfix-handoffThe ClickFix handoff document uses the same IOC tracking and timeline reconstruction patterns established in the research operations
unit-distance-methodologyThe unit distance research used the AutoResearch protocol's stall detection and direction diversity mechanisms to navigate 16 hypotheses

8. Design Principles

  1. Fresh session over resume -- context accumulation is the primary cause of cognitive loops. Each iteration starts fresh; state is injected via files.

  2. Separate execution from evaluation -- the agent doing the work does not judge its own progress. Stall determination is made by the orchestration layer based on quantitative metrics.

  3. Enforced direction diversity -- before each iteration, the system reads the list of tried directions; a new direction must differ from all history. This prevents the cognitive loop.

  4. Zero interaction during runs -- the system resolves ambiguity internally and writes reasoning to logs. The human provides direction, not micromanagement.

  5. Defense in depth for reliability -- three independent watchdog layers ensure that no single point of failure can kill a long-running research session.

  6. Local-first everything -- search, inference, vector storage, and orchestration all run on the local machine. No cloud dependencies for core functionality.