Files
codex/codex-orchestration-plan.md
Rai (Michael Pokorny) 1d86ea366d wip
2025-06-25 03:47:06 -07:00

4.2 KiB
Raw Permalink Blame History

Codex Orchestration Framework: Plan & Open Questions

This document collects the highlevel architecture, planned features, and unresolved design decisions for the proposed codex-agents orchestration framework.

1. Architecture & Core Components

  • XDGcompliant configuration & state

    • Repolocal overrides: <repo>/.codex-agent/config.toml
    • Userwide config: $XDG_CONFIG_HOME/codex-agents/config.toml
    • Global task registry: $XDG_DATA_HOME/codex-agents/tasks.json
  • CLI & optional TUI

    • codex-agent init → bootstrap repo (copy prompts, create directories)
    • codex-agent status [--tui] → show global and perrepo task/merge status
    • codex-agent config → inspect or edit effective config
    • codex-agent agents → view peragent instruction overrides
  • Task management (codex-agent task)

    • add, list, edit, worktree add|remove, validate, review, complete
    • Interactive AI Q&A flow for task add to autopopulate slug, goal, dependencies, and stub file
  • Worktree hydration

    • OSaware reflink: macOS cp -cRp, Linux cp --reflink=auto, fallback to rsync
    • COW setup via git worktree add --no-checkout + hydration step
  • Merge & Conflict Resolver (codex-agent merge)

    • merge check → dryrun merge in temp worktree
    • merge resolve → AIdriven conflict resolution or explicit bail-out
    • merge rebase → manual rebase entrypoint
  • Code Validator (codex-agent task validate|review)

    • Run linters/tests, then invoke Validator agent prompt
    • Enforce configurable policies (doc coverage, style rules, test thresholds)
  • Project Manager (codex-agent manager)

    • Wave planning, parallel launch commands, live monitoring of worktrees

2. Phased Roadmap

Phase Deliverables
1 XDG config + global tasks.json + basic `task list
2 Merge check & conflict-resolver prompt + `merge check
3 Validator agent integration + `task validate
4 Project Manager planning & launching (`manager plan
5 Interactive task add QA loop + per-agent instruction overrides
6 TUI mode for status + live dashboard
7 Polishing docs, tests, packaging, and PyPI release

3. Open Questions & Design Decisions

  1. Global registry schema

    • What additional fields should tasks.json track? (e.g. priority, owner, labels)
  2. Config file format & schema

    • TOML vs YAML vs JSON for config.toml?
    • Which policy keys to expose for Validator and Resolver agents?
  3. Peragent instruction overrides

    • How to structure override files (validator.toml, conflict-resolver.toml, etc.)?
    • Should we fallback to AGENTSstyle instruction files in the repo root if present?
  4. CLI command names & flags

    • Confirm subcommand verbs (merge resolve vs task rebase, task validate vs task lint)
    • Standardize flags for interactive vs noninteractive modes
  5. Conflict Resolver scope

    • Autoresolve only trivial hunks, or attempt full rebasebased AI resolution?
    • How and when can the agent “give up” and hand control back to the user?
  6. Validator policies & autofix

    • Default policy values (max line length, doc coverage %)
    • Should --auto-fix let the agent rewrite code, or only report issues?
  7. Interactive Task Creation

    • Best UX for prompting the user: CLI Q&A loop vs opening an editor with agent instructions?
    • How to capture dependencies and inject them into the new task stub?
  8. Session restore UX

    • Always on for codex session <UUID>, or optin via flag?
    • How to surface restore failures or drift in transcript format?
  9. TUI implementation

    • Framework choice (curses, Rich, Textual)
    • Autorefresh interval and keybindings for actions (open worktree, resolve, validate)
  10. Packaging & distribution

  • Final PyPI package name (codex-agents vs ai-orchestrator)
  • Versioning strategy and backwardscompatibility guarantees

This plan will evolve as we answer these questions and move through the roadmap phases.