Autonomous orchestrator: perceive events, evaluate against goals, decide and act within safety bounds. Runs daily via scheduled task or manual invocation.
Daily orchestrator that perceives events and perception outputs (goals, risks, research findings), evaluates them against active goals, decides actions within safety bounds, and executes them autonomously. Batches multiple Low-risk actions per run; limits Medium-risk to one.
Implements the perceive→evaluate→decide→act→record loop from the Autonomous Work Loop architecture.
/autonomous-loop — manual invocation (full run)Load Context → Build Candidates → Score → Select (batch Low, pick 1 Medium) → Risk-Gate → Execute → Record
In parallel, load:
goal_list(status="active") — active goals for evaluationmemory_recall(query="morning brief") — overnight activity + daily planmemory_recall(query="risk radar") — CI failures, security alerts, stale issuesmemory_recall(query="research findings unacted") — research outputs waiting for actionmemory_recall(query="autonomous_loop_last_run") — dedup check (don't run twice in same day)memory_recall(query="outcome patterns feedback") — past pattern detections to inform scoringconfig/repos.conf — target repos for perception + hygiene sweepDedup rule: If autonomous_loop_last_run exists and is today's date, skip gracefully (return "Already ran today").
From perception outputs, generate candidates:
find_consolidation_clusters() → consolidation action (Low-risk)config/repos.conf) — see Step 2a.For each repo R in config/repos.conf, query in parallel:
# Milestones
gh api "repos/<R>/milestones?state=open&per_page=50" --jq '.[] | {number,title,state,open_issues,closed_issues,due_on}'
# Epics without milestone
gh issue list --repo <R> --label epic --state open --json number,title,milestone,labels --limit 30
# CI runs for failure rate
gh run list --repo <R> --json conclusion,name,createdAt --limit 20
Generate candidates:
| Signal | Detection | Risk | Action |
|---|---|---|---|
| Orphan milestone | state==open && open_issues==0 | Low | gh api repos/<R>/milestones/<N> -X PATCH -F state=closed |
| Orphan sprint | label==epic && /Sprint/i.test(title) && milestone==null | Medium | Create milestone from epic title + attach epic + merged-PRs that reference it |
| CI workflow broken | Same-name workflow ≥50% fail rate in last 10 runs AND ≥24h old | Medium | Spawn debug task via /delegate pointing at the workflow file |
| Milestone deadline risk | due_on within 3 days && open_issues > 0 | — (flag only) | Add to ## Alerts in output; don't auto-act |
| Epic missing Children heading | body fails /##+\s*Children/i regex | Low | Flag + record proposal (don't auto-rewrite body — content judgment) |
Write-action permissions (enforced here):
Osasuwu/* → all Low/Medium actions execute normally.SergazyNarynov/redrobot) → flag-only: record the finding in memory (type=project, name=hygiene_sweep_proposals_<repo>_<date>) and surface it in the output, but never execute the action. Owner acts manually or flips the repo to an owned org.Dedup per-finding: before closing a milestone / creating a retroactive one, check outcome_list(task_type='autonomous', pattern_tags=['hygiene']) for matching description from last 3 days. Skip if same finding already actioned.
score = goal_alignment(0-3) × urgency(1-3) + severity_bonus + outcome_adjustment
Disqualify: unaligned (goal_alignment=0) or uncertain candidates.
Classify each candidate by risk (see Step 5), then select:
Selection filters (apply to all):
mcp-memory/server.py, SOUL.md, CLAUDE.md, .mcp.json)No candidates pass? Skip gracefully — don't invent work.
Ordering: Execute Low-risk batch first, then the Medium-risk action (if any). This ensures quick wins land even if the Medium action fails.
| Risk | Examples | Autonomy |
|---|---|---|
| Low | Create issue, fix label, memory cleanup, triage | Auto-execute |
| Medium | Run self-improve, create PR, update goal, tag memory | Auto-execute + record |
| High | Architecture change, SOUL.md, memory schema, protected files | Save proposal only |
Process the selected actions in order. Track results as {action, status, detail}.
Partial failure rule: if one action fails, log it and continue with the rest. Don't abort the batch.
Execute each independently:
gh issue create --repo <R> --title "..." --body "..."
--label epic) MUST use the .github/ISSUE_TEMPLATE/epic.yml structure: body requires ### Children heading with - [ ] checkbox items, else Issue Checks CI fails. No Parent: #NNN — epics use milestones, not parent links.Parent: #NNN at top of body.memory_store(...), goal_update(...)gh issue edit, gh pr editevents_mark_processed(...)find_consolidation_clusters() via execute_sql, for each cluster: read all memories, merge content into one authoritative memory via memory_store, archive originals via archive_memories(ids)Osasuwu/* repos): gh api repos/<R>/milestones/<N> -X PATCH -F state=closed — for each milestone with state=open && open_issues==0.memory_store(type="project", name="hygiene_epic_<N>_needs_children", ...). Don't auto-rewrite bodies.Execute after Low-risk batch completes:
/self-improve, /research, /verify/delegate or gh pr creategoal_update(slug=..., progress=...)gh api repos/<R>/milestones -X POST with title from epic, attach epic + linked merged PRs, close milestone. Only on Osasuwu/*./delegate a task to investigate the failing workflow, pointing at the specific workflow file and failure rate. Only on Osasuwu/*.Never execute — save to memory:
memory_store(type="project", name="autonomous_proposals", ...)Each action gets its own outcome_record (Pillar 3):
outcome_record(
task_type: "autonomous",
task_description: "<action title>",
outcome_status: "success" | "partial" | "failure",
outcome_summary: "<what was done, reasoning, result>",
goal_slug: "<aligned goal slug if any>",
project: "jarvis",
lessons: "<what was learned>",
pattern_tags: ["autonomous-loop", "<action-area>"]
)
After all actions complete, update dedup marker with batch summary:
memory_store(
type="project",
name="autonomous_loop_last_run",
content="{\"date\": \"YYYY-MM-DD\", \"actions_count\": N, \"succeeded\": N, \"failed\": N, \"top_action\": \"...\"}",
description="last orchestrator run",
source_provenance="skill:autonomous-loop"
)
If any action advances a goal → goal_update(slug=..., progress=[...]) — append {item: "<5-word summary> (YYYY-MM-DD)", done: true} to existing progress array.
Never:
.mcp.json, SOUL.md, CLAUDE.md, mcp-memory/server.pygh issue/pr edit) on repos outside Osasuwu/*. For other owners (e.g. SergazyNarynov/redrobot): flag-only — record the finding and surface in output, owner executes manually.Always:
autonomous_loop_last_run before actingoutcome_record# Autonomous Loop — YYYY-MM-DD
## Perception
- <N goals loaded, deadline alerts, stale work>
- <N risks flagged, severity summary>
- <N research findings, M events in queue>
## Candidates (scored)
| Action | Alignment | Urgency | Score | Risk |
|--------|-----------|---------|-------|------|
| <action 1> | <score> | <score> | <total> | Low/Med/High |
## Selected (N actions)
| # | Action | Score | Risk | Status |
|---|--------|-------|------|--------|
| 1 | <action> | N | Low | success/failure |
## Execution
- [EXECUTED / PROPOSED]: <per-action summary>
- <links to created issues/PRs/memories>
## Status
- ✓ N/M actions succeeded
- ✓ Each action recorded via `outcome_record`
- ✓ `autonomous_loop_last_run` updated
If no candidates: "No high-priority actions found. System running normally."
memory_recall with limit=1 for each query to get most recent memoryevents_list() if available; skip if unavailable