Architecture status: This README still contains historical workflow text from the legacy Python-orchestrator/dashboard direction. For the current target architecture, treat
docs/ARCHITECTURE.md,docs/TUI_UX.md,docs/SPEC_BACKEND.md, anddocs/RESEARCH_BACKEND.mdas canonical. Do not implement new primary runtime features against the legacy dashboard or Python orchestrator except as compatibility shims.
Autonomous DRL research workflow manager with orchestrator-led agent loops, hard-rule guardrails, structured logs, and a local dashboard.
This repository is forked from Karpathy AutoResearch and keeps the original AutoResearch training-loop spirit as the core.
The main research/training orchestration logic remains centered on the original local, iterative AutoResearch workflow; this fork adds DRL-focused operational features around init, environment handling, mode control, plugin scaffolding, and dashboard visibility.
- Local-first, file-based workflow in your own project directory.
- Safety and policy enforcement before risky actions.
- Reproducible experiment tracking via logs and state files.
- Token-aware orchestration: compact planning/research artifacts and controlled refresh behavior.
nxl runis orchestrator-first and continuous by default.runlaunches Codex or Claude Code as the execution backend for each cycle.- Orchestrator selects the next experiment candidate.
- If orchestrator cannot produce one, local fallback generation is used.
- Phase and loop state are persisted in
.nxl/state.json.
During init, users choose one project mode:
buildmode:- For empty or incomplete training projects.
- System performs deep research and creates compact plan steps in
implementation_plan/*.mdbefore build/training loop starts. - After bootstrap completes successfully, the plan folder is removed and a compact summary is logged to keep future context short.
improvemode:- For existing working models.
- System starts optimization-focused iteration directly.
Both modes support stuck-driven research/plan refresh without disabling existing capabilities.
During init, users choose one skill-pack strategy:
drl:- Keep the provided compact DRL skill pack in project scope.
custom:- Remove bundled DRL skills in the target project.
- Install
.nxl/backend/skill_generator.mdto generate domain-specific compact skills from user spec/rules.
Skill generation policy for custom pack:
- Keep generated skills compact (token-efficient).
- Keep skills general/basic technique-level (like DRL pack style).
- Avoid heavy, overly detailed implementation plans inside skills.
Init onboarding captures key inputs including:
- project/task basics (domain, objective, constraints)
- other information (quirks, known issues, extra context)
- hardware and runtime assumptions
- Python environment preferences
- permission policy
- hard rules and non-negotiables
These settings are saved into .nxl/ and reused by init/run/doctor flows.
After init, the system auto-generates:
.nxl/spec_compact.md(compact navigator).nxl/spec_index.json(machine-readable pointer index)
Design intent:
- structure is source-driven (derived from the actual spec/rules document structure), not a fixed hard-coded schema
- compact file is for fast navigation only
- original source files remain the source of truth for detailed clarification
- entries include line pointers (for example
USER_SPEC.md:300) so agents can jump directly to relevant details without loading whole files
nxl doctorvalidates runtime health.nxl doctor --fixattempts remediation automatically:- uses onboarding env preferences
- creates/uses project venv when needed
- installs missing dependencies
- includes fallback handling for externally-managed Python environments (PEP 668)
- Init triggers best-effort remediation so setup issues are handled early.
- Stuck detection can trigger research/plan refresh when progress stalls.
- Refresh trigger is orchestrator-first, with local fallback heuristics.
- Cooldown state prevents repeated refresh loops that waste tokens.
- State includes mode/bootstrap/refresh metadata for observability.
Dashboard includes workflow snapshot fields such as:
- current mode
- loop running / idle state
- active run id
- current agent backend
- bootstrap started/completed state
- refresh cooldown remaining runs
- last refresh reason
This is in addition to normal training/registry status views.
- Python 3.10+
- Linux recommended (macOS partial support)
- GPU optional (CPU works, typically slower)
git clone https://github.com/Ian747-tw/autoresearch-RL
cd autoresearch-RL
pipx install --force .This installs nxl once for your user account so it can be run
from any directory.
Verify CLI:
which nxl
nxl --helpIf which nxl returns nothing after install, open a new shell once
or run source ~/.bashrc.
Recommended verification that the installed command is using the expected package:
PIPX_PY="$(head -n 1 "$(which nxl)" | sed 's/^#!//')"
"$PIPX_PY" - <<'PY'
import nxl, nxl.core.onboarding as ob
print(nxl.__file__)
print(ob.__file__)
PYUse plain python3 -c 'import nxl' only if you installed the
package into that same Python environment. A cloned repo and an installed CLI
are separate copies.
Alternative if you prefer a repo-linked editable install instead of a global
pipx app:
git clone https://github.com/Ian747-tw/autoresearch-RL
cd autoresearch-RL
python3 -m pip install --user -e .cd ~/autoresearch-RL
git fetch origin
git checkout master
git pull --ff-only origin master
pipx install --force .If you use the editable install path instead of pipx, update with:
cd ~/autoresearch-RL
git fetch origin
git checkout master
git pull --ff-only origin master
python3 -m pip install --user -e .- Create or choose your training project directory.
- Put project spec/rules/constraints in place (or provide them during onboarding).
cd /path/to/your-project
nxl initInit flow:
- Creates baseline structure (
.nxl/,logs/,skills/, config files). - Runs onboarding questionnaire (unless skipped).
- Captures skill-pack choice (
drlorcustom). - Captures project mode (
buildorimprove). - Installs selected plugin assets (
cc,codex,both,none). - Auto-generates compact spec/index artifacts with source line pointers.
- Runs best-effort environment remediation.
- Persists startup state for orchestrator and dashboard.
Non-interactive examples:
nxl init --auto
nxl init --project-mode build --skill-pack custom --plugin codex --skip-onboarding
nxl init --refreshRefresh behavior:
nxl init --refreshremoves NexusLoop-managed config, runtime state, skill-pack files, and plugin scaffolding from the target project, then runs init again from scratch.- It does not delete your source code or arbitrary project files.
nxl doctor
nxl doctor --fixUse --fix if dependencies/interpreter setup are not healthy.
nxl runBehavior summary:
- In
buildmode:- bootstrap research + compact implementation plan happens first
- then the controller keeps launching agent-driven coding/training cycles
- bootstrap plan folder is removed after build bootstrap completion
- compact summary is written to project log/journal
- In
improvemode:- immediate continuous agent-driven optimization loop
Runtime notes:
runnow stays alive until interrupted, convergence is reached, or a hard policy block stops it.- The controller launches Codex or Claude Code in autonomous mode for each cycle.
- Use
--onceif you want a single cycle and exit. - Use
--agent-backend codexor--agent-backend claudeto force one backend. - Autonomous runs require onboarding permission policy
open,project-only, orbootstrap-only. - During autonomous cycles, risky actions must go through
nxl check. - Registry/journal/incidents/handoffs are expected to be written through the project helper APIs, not raw file edits.
User-simulation end-to-end tests live under tests/e2e_user/. These are
local/release-gate scenarios that install NexusLoop into a fresh sandbox and
exercise the real nxl CLI. They are intentionally not part of the default
pull-request CI workflow in .github/workflows/ci.yml.
Run them locally from a clean checkout with the same dependency order used by the release-gate workflow:
uv sync
(cd agentcore/server-fork && bun install)
uv run pytest tests/e2e_user/ -v --tb=shortGitHub runs the same suite only in .github/workflows/e2e.yml, which is
triggered manually via workflow_dispatch and automatically on version tags
matching v*.
nxl status
nxl plan --refresh
nxl researchIf your agent session drops or you start a new session, use one-line resume:
nxl resume --project-dir .This performs compact sync (status + tail windows of registry/journal/handoffs) and then continues the run loop automatically.
Agents decide whether each run is a full baseline/real local eval or only a
temporary, partial, or specific test. Only full baseline/local eval results
should be promoted to registry/dashboard; the rest should keep raw outputs in
logs/runs/<run_id>/ without adding registry/dashboard entries.
If you want to add fresh guidance during resume, pass a one-shot message:
nxl resume --project-dir . --message "Keep the current plan, but prioritize fixing the data loader first."The resume message is merged as additional guidance unless it conflicts with stale queued intent, in which case the new human instruction wins.
nxl dashboard --port 8765Open http://localhost:8765.
If you want to blank dashboard backend data while preserving all logs:
nxl dashboard --project-dir . --clear-offlineInstalls to .claude/commands/:
drl-init.mddrl-run.mddrl-plan.mddrl-diagnose.mddrl-research.md
- Installs
AGENT.mdin project root. - Codex integration is file-based; no separate project-side
codex/directory is required.
nxl init \
[--project-dir DIR] \
[--skip-onboarding] \
[--auto] \
[--plugin {cc,codex,both,none}] \
[--skill-pack {drl,custom}] \
[--project-mode {build,improve}]nxl doctor [--project-dir DIR] [--fix]nxl run [--project-dir DIR] [--parallel N] [--dry-run] [--once] [--agent-backend {auto,codex,claude}]nxl resume [--project-dir DIR] [--parallel N] [--dry-run] [--no-run] [--message TEXT]nxl status [--project-dir DIR]
nxl plan [--project-dir DIR] [--refresh]
nxl research [--project-dir DIR]
nxl resume [--project-dir DIR] [--parallel N] [--dry-run] [--no-run] [--message TEXT]
nxl check --action ACTION [--details JSON] [--project-dir DIR]
nxl dashboard [--project-dir DIR] [--port PORT] [--clear-offline]- Build bootstrap plans are intentionally compact and temporary.
- Stuck refresh is cooldown-controlled to prevent repetitive research churn.
- Custom skills are designed to be concise and technique-oriented, not verbose implementation documents.
- Existing backbone files remain the source of truth:
.nxl/,logs/,skills/, compact spec files, dashboard artifacts, andNON_NEGOTIABLE_RULES.md.
doctor --fixis best-effort and depends on package index/network reachability.- Checks reflect the interpreter context used to run the CLI.
- Dashboard is local HTTP and intended for local/private usage.
- Continuous autonomous runs depend on a working
codexorclaudeCLI being installed on the machine.