Skip to content

Orchestration Verification Kernel

LingXiao doesn’t just dispatch tasks — it performs structured verification on every completed task. The orchestration kernel uses speculative execution, adversarial verification, adaptive routing, and contract loops to make task results verifiable, traceable, and repairable.

Task lifecycle events (create/update/dispatch/complete) automatically trigger the verification pipeline, extracting PASS/FAIL/BLOCKED verdicts:

The same task can run multiple parallel implementation branches, with the best one selected by strategy:

StrategyDescription
first_greenFirst branch to pass verification wins
fewest_changesBranch with minimal diff that passes wins
fastest_testsBranch with fastest tests that passes wins
  • Each branch has an isolated working directory and write scope
  • VerificationPipeline verifies each branch independently
  • Losing branches are cleaned up automatically
  • Default timeout: 30 minutes
  • Maximum 6 parallel branches

AdversarialVerifier runs command-level breaker strategies:

interface BreakerStrategy {
command: string; // Verification command
expectedExitCode: number; // Expected exit code
failOnExitCode: number; // Failure exit code
}
  1. Execute breaker command
  2. Collect stdout, stderr, execution duration, timeout status
  3. Determine verdict:
    • PASS: All strategies pass
    • FAIL: Any strategy fails
    • BLOCKED: Infrastructure issues

AdaptiveHarness uses difficulty signals to intelligently route tasks:

SignalDescription
cross_module_depsCross-module dependency count
hotspot_overlapOverlap with known hotspot regions
prior_failuresHistorical failure rate
impact_ratioImpact surface ratio
has_ambiguous_pathWhether ambiguous paths exist
dependency_countDependency count

Based on signals, execution strategy is auto-selected:

  • fast_path: Small scope, low-risk tasks, single Worker fast execution
  • standard: Medium complexity, standard scheduling
  • speculative: High-difficulty tasks, multi-branch speculative execution
  • contract_first: Cross-stack tasks, define contract before implementation

A five-phase loop ensures cross-stack implementation consistency:

PhaseDescription
contractDefine interface contracts (schema, error codes, state flows)
implementImplement frontend/backend code per contract
evaluateVerify implementation matches contract
repairFix parts that don’t match contract
resetReset and enter next round (if needed)

Contract blackboard nodes are automatically materialized to the .lingxiao/contracts/ directory, shared by all Agents.

The Bughunt DAG scheduler runs in isolated worktrees:

  • DAG scheduling: Bug hunting tasks are orchestrated by dependency relationships
  • Evidence collection: Automatically collects reproduction steps, stack traces, environment info
  • Evidence extraction: Extracts key evidence from logs and output
  • Evidence packaging: Packages evidence for review
  • Discovery ledger: Records all bug findings and fix history

Agents can declare verifiable assumptions, auto-reverified on code changes:

interface Assumption {
verification_type: 'type_check' | 'file_content' | 'test_execution' | 'ast_query';
target: string; // Verification target (file path, test name, etc.)
expected: string; // Expected result (exact text match)
}
TypeDescription
type_checkTypeScript type checking
file_contentFile content matching
test_executionTest execution results
ast_queryAST query assertions

When an assumption is falsified, the system feeds back to the Agent, requiring it to stop the current wrong direction and correct its understanding.