feat: add multi-runtime support (coord run, prdy --codex) and next-task capsule
- coord/prdy subcommands now accept --claude/--codex runtime flags - New `mosaic coord run` generates continuation context and launches selected runtime, replacing manual copy/paste workflow - Next-task capsule (.mosaic/orchestrator/next-task.json) provides machine-readable execution context for deterministic session launches - Codex strict orchestrator profile added to runtime/codex/RUNTIME.md - Orchestrator protocol updated with between-session run flow - New smoke-test.sh for orchestration behavior verification Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
109
bin/mosaic
109
bin/mosaic
@@ -53,8 +53,8 @@ Management:
|
||||
|
||||
PRD:
|
||||
prdy <subcommand> PRD creation and validation
|
||||
init Create docs/PRD.md via Claude session
|
||||
update Update existing PRD via Claude session
|
||||
init Create docs/PRD.md via guided runtime session
|
||||
update Update existing PRD via guided runtime session
|
||||
validate Check PRD completeness (bash-only)
|
||||
|
||||
Coordinator (r0):
|
||||
@@ -63,6 +63,7 @@ Coordinator (r0):
|
||||
mission Show mission progress dashboard
|
||||
status Check agent session health
|
||||
continue Generate continuation prompt
|
||||
run Generate context and launch selected runtime
|
||||
resume Crash recovery
|
||||
|
||||
Options:
|
||||
@@ -481,26 +482,59 @@ run_seq() {
|
||||
|
||||
run_coord() {
|
||||
check_mosaic_home
|
||||
local subcmd="${1:-help}"
|
||||
shift || true
|
||||
local runtime="claude"
|
||||
local runtime_flag=""
|
||||
local -a coord_args=()
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--claude|--codex)
|
||||
local selected_runtime="${1#--}"
|
||||
if [[ -n "$runtime_flag" ]] && [[ "$runtime" != "$selected_runtime" ]]; then
|
||||
echo "[mosaic] ERROR: --claude and --codex are mutually exclusive for 'mosaic coord'." >&2
|
||||
exit 1
|
||||
fi
|
||||
runtime="$selected_runtime"
|
||||
runtime_flag="$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
coord_args+=("$1")
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
local subcmd="${coord_args[0]:-help}"
|
||||
if (( ${#coord_args[@]} > 1 )); then
|
||||
set -- "${coord_args[@]:1}"
|
||||
else
|
||||
set --
|
||||
fi
|
||||
|
||||
local tool_dir="$MOSAIC_HOME/tools/orchestrator"
|
||||
|
||||
case "$subcmd" in
|
||||
status|session)
|
||||
exec bash "$tool_dir/session-status.sh" "$@"
|
||||
MOSAIC_COORD_RUNTIME="$runtime" exec bash "$tool_dir/session-status.sh" "$@"
|
||||
;;
|
||||
init)
|
||||
exec bash "$tool_dir/mission-init.sh" "$@"
|
||||
MOSAIC_COORD_RUNTIME="$runtime" exec bash "$tool_dir/mission-init.sh" "$@"
|
||||
;;
|
||||
mission|progress)
|
||||
exec bash "$tool_dir/mission-status.sh" "$@"
|
||||
MOSAIC_COORD_RUNTIME="$runtime" exec bash "$tool_dir/mission-status.sh" "$@"
|
||||
;;
|
||||
continue|next)
|
||||
exec bash "$tool_dir/continue-prompt.sh" "$@"
|
||||
MOSAIC_COORD_RUNTIME="$runtime" exec bash "$tool_dir/continue-prompt.sh" "$@"
|
||||
;;
|
||||
run|start)
|
||||
MOSAIC_COORD_RUNTIME="$runtime" exec bash "$tool_dir/session-run.sh" "$@"
|
||||
;;
|
||||
smoke|test)
|
||||
MOSAIC_COORD_RUNTIME="$runtime" exec bash "$tool_dir/smoke-test.sh" "$@"
|
||||
;;
|
||||
resume|recover)
|
||||
exec bash "$tool_dir/session-resume.sh" "$@"
|
||||
MOSAIC_COORD_RUNTIME="$runtime" exec bash "$tool_dir/session-resume.sh" "$@"
|
||||
;;
|
||||
help|*)
|
||||
cat <<COORD_USAGE
|
||||
@@ -511,12 +545,23 @@ Commands:
|
||||
mission [--project <path>] Show mission progress dashboard
|
||||
status [--project <path>] Check agent session health
|
||||
continue [--project <path>] Generate continuation prompt for next session
|
||||
run [--project <path>] Generate context and launch selected runtime
|
||||
smoke Run orchestration behavior smoke checks
|
||||
resume [--project <path>] Crash recovery (detect dirty state, generate fix)
|
||||
|
||||
Runtime:
|
||||
--claude Use Claude runtime hints/prompts (default)
|
||||
--codex Use Codex runtime hints/prompts
|
||||
|
||||
Examples:
|
||||
mosaic coord init --name "Security Fix" --milestones "Critical,High,Medium"
|
||||
mosaic coord mission
|
||||
mosaic coord --codex mission
|
||||
mosaic coord continue --copy
|
||||
mosaic coord run
|
||||
mosaic coord run --codex
|
||||
mosaic coord smoke
|
||||
mosaic coord continue --codex --copy
|
||||
|
||||
COORD_USAGE
|
||||
;;
|
||||
@@ -552,33 +597,65 @@ _check_resumable_session() {
|
||||
|
||||
run_prdy() {
|
||||
check_mosaic_home
|
||||
local subcmd="${1:-help}"
|
||||
shift || true
|
||||
local runtime="claude"
|
||||
local runtime_flag=""
|
||||
local -a prdy_args=()
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--claude|--codex)
|
||||
local selected_runtime="${1#--}"
|
||||
if [[ -n "$runtime_flag" ]] && [[ "$runtime" != "$selected_runtime" ]]; then
|
||||
echo "[mosaic] ERROR: --claude and --codex are mutually exclusive for 'mosaic prdy'." >&2
|
||||
exit 1
|
||||
fi
|
||||
runtime="$selected_runtime"
|
||||
runtime_flag="$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
prdy_args+=("$1")
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
local subcmd="${prdy_args[0]:-help}"
|
||||
if (( ${#prdy_args[@]} > 1 )); then
|
||||
set -- "${prdy_args[@]:1}"
|
||||
else
|
||||
set --
|
||||
fi
|
||||
|
||||
local tool_dir="$MOSAIC_HOME/tools/prdy"
|
||||
|
||||
case "$subcmd" in
|
||||
init)
|
||||
exec bash "$tool_dir/prdy-init.sh" "$@"
|
||||
MOSAIC_PRDY_RUNTIME="$runtime" exec bash "$tool_dir/prdy-init.sh" "$@"
|
||||
;;
|
||||
update)
|
||||
exec bash "$tool_dir/prdy-update.sh" "$@"
|
||||
MOSAIC_PRDY_RUNTIME="$runtime" exec bash "$tool_dir/prdy-update.sh" "$@"
|
||||
;;
|
||||
validate|check)
|
||||
exec bash "$tool_dir/prdy-validate.sh" "$@"
|
||||
MOSAIC_PRDY_RUNTIME="$runtime" exec bash "$tool_dir/prdy-validate.sh" "$@"
|
||||
;;
|
||||
help|*)
|
||||
cat <<PRDY_USAGE
|
||||
mosaic prdy — PRD creation and validation tools
|
||||
|
||||
Commands:
|
||||
init [--project <path>] [--name <feature>] Create docs/PRD.md via guided Claude session
|
||||
update [--project <path>] Update existing docs/PRD.md via Claude session
|
||||
init [--project <path>] [--name <feature>] Create docs/PRD.md via guided runtime session
|
||||
update [--project <path>] Update existing docs/PRD.md via guided runtime session
|
||||
validate [--project <path>] Check PRD completeness against Mosaic guide (bash-only)
|
||||
|
||||
Runtime:
|
||||
--claude Use Claude runtime (default)
|
||||
--codex Use Codex runtime
|
||||
|
||||
Examples:
|
||||
mosaic prdy init --name "User Authentication"
|
||||
mosaic prdy update
|
||||
mosaic prdy --codex init --name "User Authentication"
|
||||
mosaic prdy validate
|
||||
|
||||
Output location: docs/PRD.md (per Mosaic PRD guide)
|
||||
|
||||
Reference in New Issue
Block a user