Nyx / Expedition / proposal v3 · the loop, grounded in the field

Give it the goal.
It runs its own loop.

A marathon follows a fixed route: plan, build, verify, done. Expedition doesn't have a route. It looks at where it is, picks its own next move, research, redesign, build, or diagnose, and keeps looping until the thing is done or it hits a wall only you can clear. When it gets stuck, it works out why and changes approach instead of retrying into the same wall.

/expeditionfigure out how to make money on kalshi + polymarket, then build it
Why a loop and not a marathon

A marathon can't change
its own mind.

Marathons are the right tool for work you can specify up front. But the moment reality contradicts the plan, a fixed pipeline can only retry the same step. Expedition is built for the opposite case: goals where the plan has to change as you learn.

Marathon · fixed DAG

Plan once, then execute

  • Decompose the goal into subtasks, up front, from the repo and priors.
  • Fan out workers, synthesize, verify.
  • On failure: retry the same increment, up to a cap.
  • After the cap: wedge, halt, wait for you.
  • Cannot decide the plan itself was wrong.
good for: specified work · bounded, predictable, cheap
Expedition · adaptive loop

Decide the next move, every step

  • Start with a hunch, learn as it goes.
  • Choose freely: research, architect, build, diagnose.
  • On failure: work out why, then switch approach.
  • Can throw out its own design and redesign.
  • Stops only when done, or at a wall you must clear.
good for: undefined work · flexible, exploratory, bounded by guardrails
How everyone else does it

Two camps.
Neither does the whole job.

We studied the field before designing this. It splits cleanly in two, and the split is the opening. Research agents produce a report and stop. Coding agents plan then build, but only ever research the repo in front of them, and charge ahead when the goal is ambiguous or impossible.

OpenAI Deep Research
Research agent
Nails: one model trained by reinforcement learning to plan, browse, backtrack, and cite inline. Breaks: weak confidence calibration, states wrong numbers with total conviction, and stops at a document.
system card
Anthropic multi-agent
Research agent
Nails: a lead agent spawns parallel subagents in isolated context, with a dedicated citation pass. Breaks: about 15x the tokens of a chat, and it researches, it does not build.
the writeup
STORM (Stanford)
Research agent
Nails: discovers diverse perspectives by surveying related articles, then simulates expert interviews for real breadth. Breaks: inherits its sources' bias, skews Wikipedia-shaped, report only.
the paper
GPT-Researcher
Research agent
Nails: planner, then parallel executors per question, then a publisher, all open. Breaks: it writes a report, not a build, and deep runs get slow and costly.
the repo
Devin
Build agent
Nails: an explicit plan DAG and a confidence score that gates on ambiguity. Breaks: below that gate it assumes and proceeds anyway, then thrashes for a day on a mis-scoped task, hallucinating features.
field report
OpenHands
Build agent
Nails: an event-stream loop plus a real stuck detector that catches five loop types. Breaks: on stuck it halts rather than switching, and it hallucinates imports when it acts before it understands.
stuck detector
Cursor · Claude Code · Copilot
Build agent
Nails: an editable plan artifact behind a hard read-only gate. Breaks: the research is repo-shallow with no feasibility check, and independent tests found the plan gets ignored on most non-trivial tasks.
the study
Factory
Build agent
Nails: an Explore, Plan, Code, Verify loop with a recovery playbook and saved plan artifacts. Breaks: closed and enterprise-shaped, and its research stays scoped to the codebase.
agent-native dev
The gap

Nobody fuses the two. The research agents can't build. The build agents don't research the world or check feasibility, they assume, then thrash. And across the board, agents recognize an impossible task only 37 to 45 percent of the time, while a study of 1,023 API endpoints found every integration failure traced to a spec that lied. One adaptive loop that researches the world, gates on feasibility, and can circle back mid-build is the whole opening.

The loop

Orient. Decide. Act.
Observe. Again.

One controller sits at the center. Each turn it reads the current state, decides the single best next move, dispatches that capability, and folds the result back in. The traveling mark is the loop running. It exits down and right: shipped, or blocked on something only you can decide.

The moves it can make

Four capabilities.
Any order. Its call.

These aren't phases in a line. Each turn the controller picks whichever one the situation needs. It might research three times before building, or build, hit a wall, and jump straight to redesign.

Move 01
Research
Fan out parallel search over web and repo. Prior art, real API shapes, the actual constraints. Returns a cited findings brief.
Move 02
Architect
Turn what it knows into a system: stack, data model, boundaries, trade-offs, risks named out loud. Can be re-run to redesign mid-flight.
Move 03
Build
Hand a bounded, specified chunk to the marathon engine you already trust. Decompose, workers, verify. Returns a result and a verdict.
Recover
Diagnose
When a move fails or repeats, work out the real cause, write down what went wrong, and choose a different next move instead of retrying.
When it gets stuck

The point isn't retrying.
It's changing approach.

Naive agents loop forever, calling the same failing tool with the same arguments. Expedition watches for that and treats it as a signal to think differently, not try harder.

Detect

The controller tracks every move and its outcome. Stuck means the same action, the same failure, twice, or no forward progress across a few turns.

signals: repeated action + args · verify failing the same way · state unchanged in k steps
Recover

It stops, writes a short critique of what actually went wrong, and forces a different move: maybe the build needs research, maybe the design was the bug.

self-critique then a new move, never the same one · this is the Reflexion pattern, applied at the orchestration level
Where we go past them

Six things the field
doesn't do well.

Every piece below is a documented weakness in the systems above. Expedition's bet is to fix all six inside one loop. It starts before the loop even runs, with the move nobody makes: a feasibility gate.

Feasibility gate on move zero
the 37-45% blind spot
Before any build, run the goal through the impossibility taxonomy and a live probe, then return go, go-with-constraints, or blocked-and-why. Catching it early is worth over 10x the cost of failing late.
Probe the real API first
specs lie
1,023 endpoints tested, and every failure was a spec defect, not agent logic. So every endpoint, entitlement, and package gets a live existence-check before it's allowed into the plan. A hallucinated name is a query, not a dead end.
Research becomes the spec
not a report
Deep-research agents stop at a document. Here every design decision is traceable to a cited finding and tagged confirmed, inferred, or unverified, so the builder knows exactly where to add its own checks.
Stuck means switch, not retry
detect then change
Other agents detect the loop and halt. Expedition detects it and diagnoses, then picks a different move. Just the rule "don't retry identical arguments" cuts blind retries from about 60% to 10%.
Back to research, mid-build
a legal transition
The day-long thrash is the absence of this. When a build step contradicts an assumption, the loop pops back to research or redesign for that one slice instead of patching forward into the wall.
Recon cached as memory
start grounded
The reality-patch for an API, the verified findings, the module map, all persisted. The second run against Kalshi starts grounded instead of re-browsing cold, cutting the heavy token cost the research systems pay every time.
Watch the loop think

Three goals.
Three different paths.

Your examples, as loop traces. Notice none of them run the moves in the same order, and one of them gets stuck and recovers.

/expeditionFind vulnerabilities in this system and patch them
research · map the attack surface, the deps, known CVE classes for this stack
build · patch the highest-blast-radius hole first, with a reproduction test
diagnose · the patch broke two other tests. why? the fix touched a shared path
architect · redesign the fix to isolate the change
build · re-patch, all green, move to the next vuln · ship
/expeditionUse Kalshi + Polymarket to make money, research how others do it, then build it
research · the two APIs, order-book and fee models, how sharps run arbitrage and positive-EV
research · not enough. dig into resolution-rule traps that turn a sure arb into a coin flip
architect · ingest, matcher, net-of-fees engine, free vs pro split
build · the monitor in Rust · ship
this exact research was just done by hand. that it can be automatic is the whole pitch.
/expeditionBuild an iPhone alarm app that can't be deleted and is extremely loud
research · what iOS actually permits: Guided Access, supervised MDM, audio that ignores the mute switch
diagnose · "can't be deleted" isn't possible for a normal App Store app. surface that honestly, don't fake it
architect · the real approach given the constraints, plus a plain note on the hard limit
build · a buildable app that does the possible part well · ship with an honest caveat
Proven parts

Every piece already
works somewhere.

The loop, the recovery, the research fan-out, the design phase. We're assembling known patterns, not betting on a new idea.

Reason, act, observe
ReAct loop
The controller reasons about the current state, acts, sees the result, reasons again. Adaptive by construction, no fixed plan up front.
agentic loops
Critique, then retry differently
Reflexion
After a failure the agent writes what went wrong, stores it, and injects it into the next attempt. This is the Diagnose move.
the four patterns
Don't retry into the wall
Stuck detection
Hash action and args, detect repeats and no-progress, then inject "you already tried this, do something different." Cuts blind retries from ~60% to ~10%.
detecting stuck agents
Lead agent, parallel workers
Orchestrator-worker research
The Research move fans out parallel subagents in isolated context, then synthesizes. Anthropic's own pattern for deep research.
how it's built
The build

One controller.
The rest already exists.

The moves reuse what's in the codebase: research tools on every worker, the marathon engine for Build, the verify gate. The new thing is the controller that decides between them and recovers when stuck.

planner/expedition-loop.ts
newThe controller. Orient, decide the next move, dispatch a capability, observe, repeat. Holds the running state and the move history.
planner/moves/*.ts
newOne module per move: research (fan-out + synthesize), architect (design pass), build (delegate to the marathon engine), diagnose (self-critique + pick next).
planner/stuck-detector.ts
newHashes move + args + outcome, flags repeats and no-progress, forces a Diagnose move.
planner/orchestrator.ts
Build reuses execute()'s decompose, fanout, verify. The loop calls into it for a bounded chunk instead of owning the whole run.
routes/concierge.ts
Route /expedition into the loop instead of the hardcoded brief. The stub becomes the real engine.
guardrails, because a free loop needs a leash:
step ceiling and cost cap per run · hard stop at money or irreversible actions, surfaced to you, never auto-crossed · every move logged so you can read the whole trace.