123123echo -e " ${GREEN} ✓${NC} next plan"
124124PASS=$(( PASS + 1 ))
125125
126- $FLOWCTL epic set-plan- review-status " $EPIC1 " --status ship --json > /dev/null
126+ $FLOWCTL epic review " $EPIC1 " ship --json > /dev/null
127127work_json=" $( $FLOWCTL next --json) "
128128" $PYTHON_BIN " - " $work_json " " $EPIC1 " << 'PY '
129129import json, sys
@@ -236,24 +236,29 @@ show_json="$($FLOWCTL show "$EPIC1" --json)"
236236" $PYTHON_BIN " - << 'PY ' "$show_json"
237237import json, sys
238238data = json.loads(sys.argv[1])
239- assert data.get("plan_review_status") == "unknown"
239+ assert data.get("plan_review_status") is None or data.get("plan_review_status") == "unknown"
240240assert data.get("plan_reviewed_at") is None
241241assert data.get("branch_name") is None
242242PY
243243echo -e " ${GREEN} ✓${NC} plan_review_status defaulted"
244244PASS=$(( PASS + 1 ))
245245
246246echo -e " ${YELLOW} --- branch_name set ---${NC} "
247- $FLOWCTL epic set- branch " $EPIC1 " --branch " ${EPIC1} -epic" --json > /dev/null
247+ $FLOWCTL epic branch " $EPIC1 " " ${EPIC1} -epic" --json > /dev/null
248248show_json=" $( $FLOWCTL show " $EPIC1 " --json) "
249- " $PYTHON_BIN " - " $show_json " " $EPIC1 " << 'PY '
249+ if " $PYTHON_BIN " - " $show_json " " $EPIC1 " << 'PY ' 2>/dev/null
250250import json, sys
251251data = json.loads(sys.argv[1])
252252expected_branch = f"{sys.argv[2]}-epic"
253253assert data.get("branch_name") == expected_branch, f"Expected {expected_branch}, got {data.get('branch_name')}"
254254PY
255- echo -e " ${GREEN} ✓${NC} branch_name set"
256- PASS=$(( PASS + 1 ))
255+ then
256+ echo -e " ${GREEN} ✓${NC} branch_name set"
257+ PASS=$(( PASS + 1 ))
258+ else
259+ echo -e " ${RED} ✗${NC} branch_name set: show does not return branch_name (DB-only field)"
260+ FAIL=$(( FAIL + 1 ))
261+ fi
257262
258263echo -e " ${YELLOW} --- epic set-title ---${NC} "
259264# Create epic with tasks for rename test
@@ -265,7 +270,7 @@ $FLOWCTL task create --epic "$RENAME_EPIC" --title "Second task" --json >/dev/nu
265270$FLOWCTL dep add " ${RENAME_EPIC} .2" " ${RENAME_EPIC} .1" --json > /dev/null
266271
267272# Rename epic
268- rename_result=" $( $FLOWCTL epic set- title " $RENAME_EPIC " --title " New Shiny Title" --json) "
273+ rename_result=" $( $FLOWCTL epic title " $RENAME_EPIC " --title " New Shiny Title" --json) "
269274NEW_EPIC=" $( echo " $rename_result " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin)["new_id"])' ) "
270275
271276# Test 1: Verify old files are gone
@@ -342,7 +347,7 @@ DEP_EPIC_JSON="$($FLOWCTL epic create --title "Depends on renamed" --json)"
342347DEP_EPIC=" $( echo " $DEP_EPIC_JSON " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin)["id"])' ) "
343348$FLOWCTL epic add-dep " $DEP_EPIC " " $NEW_EPIC " --json > /dev/null
344349# Rename the dependency
345- rename2_result=" $( $FLOWCTL epic set- title " $NEW_EPIC " --title " Final Title" --json) "
350+ rename2_result=" $( $FLOWCTL epic title " $NEW_EPIC " --title " Final Title" --json) "
346351FINAL_EPIC=" $( echo " $rename2_result " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin)["new_id"])' ) "
347352# Verify DEP_EPIC's depends_on_epics was updated
348353" $PYTHON_BIN " - " $DEP_EPIC " " $FINAL_EPIC " << 'PY '
@@ -917,7 +922,7 @@ cd "$TEST_DIR/repo"
917922STDIN_EPIC_JSON=" $( $FLOWCTL epic create --title " Stdin test" --json) "
918923STDIN_EPIC=" $( echo " $STDIN_EPIC_JSON " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin)["id"])' ) "
919924# Test epic set-plan with stdin
920- $FLOWCTL epic set- plan " $STDIN_EPIC " --file - --json << 'EOF '
925+ $FLOWCTL epic plan " $STDIN_EPIC " --file - --json << 'EOF '
921926# Stdin Test Plan
922927
923928## Overview
@@ -998,7 +1003,7 @@ $FLOWCTL checkpoint save --epic "$STDIN_EPIC" --json >/dev/null
9981003# Verify checkpoint file exists
9991004[[ -f " .flow/.checkpoint-${STDIN_EPIC} .json" ]] || { echo " checkpoint file not created" ; FAIL=$(( FAIL + 1 )) ; }
10001005# Modify epic spec
1001- $FLOWCTL epic set- plan " $STDIN_EPIC " --file - --json << 'EOF '
1006+ $FLOWCTL epic plan " $STDIN_EPIC " --file - --json << 'EOF '
10021007# Modified content
10031008EOF
10041009# Restore from checkpoint
@@ -1806,7 +1811,7 @@ $FLOWCTL task create --epic "$EPIC_AE" --title "AE task 1" --json > /dev/null
18061811$FLOWCTL task create --epic " $EPIC_AE " --title " AE task 2" --json > /dev/null
18071812
18081813# Set pending marker
1809- ae_pending=" $( $FLOWCTL epic set- auto-execute " $EPIC_AE " --pending --json) "
1814+ ae_pending=" $( $FLOWCTL epic auto-exec " $EPIC_AE " --pending --json) "
18101815ae_pending_val=" $( echo " $ae_pending " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin)["auto_execute_pending"])' ) "
18111816if [[ " $ae_pending_val " == " True" ]]; then
18121817 echo -e " ${GREEN} ✓${NC} set-auto-execute --pending sets marker"
@@ -1834,7 +1839,7 @@ else
18341839fi
18351840
18361841# Clear marker with --done
1837- ae_done=" $( $FLOWCTL epic set- auto-execute " $EPIC_AE " --done --json) "
1842+ ae_done=" $( $FLOWCTL epic auto-exec " $EPIC_AE " --done --json) "
18381843ae_done_val=" $( echo " $ae_done " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin)["auto_execute_pending"])' ) "
18391844if [[ " $ae_done_val " == " False" ]]; then
18401845 echo -e " ${GREEN} ✓${NC} set-auto-execute --done clears marker"
@@ -1886,46 +1891,46 @@ EPIC_PH="$(echo "$EPIC_PH_JSON" | "$PYTHON_BIN" -c 'import json,sys; print(json.
18861891$FLOWCTL task create --epic " $EPIC_PH " --title " Phase task" --json > /dev/null
18871892$FLOWCTL start " ${EPIC_PH} .1" --json > /dev/null
18881893
1889- # Test: worker-phase next returns phase 0 initially (worktree+teams default)
1894+ # Test: worker-phase next returns phase 1 initially (worktree+teams default)
18901895wph_next=" $( $FLOWCTL worker-phase next --task " ${EPIC_PH} .1" --json) "
18911896wph_phase=" $( echo " $wph_next " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin)["phase"])' ) "
18921897wph_done=" $( echo " $wph_next " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin)["all_done"])' ) "
1893- if [[ " $wph_phase " == " 0 " ]] && [[ " $wph_done " == " False" ]]; then
1894- echo -e " ${GREEN} ✓${NC} worker-phase next: initial phase is 0 (worktree+teams default)"
1898+ if [[ " $wph_phase " == " 1 " ]] && [[ " $wph_done " == " False" ]]; then
1899+ echo -e " ${GREEN} ✓${NC} worker-phase next: initial phase is 1 (worktree+teams default)"
18951900 PASS=$(( PASS + 1 ))
18961901else
1897- echo -e " ${RED} ✗${NC} worker-phase next: expected phase=0 all_done=False, got phase=$wph_phase all_done=$wph_done "
1902+ echo -e " ${RED} ✗${NC} worker-phase next: expected phase=1 all_done=False, got phase=$wph_phase all_done=$wph_done "
18981903 FAIL=$(( FAIL + 1 ))
18991904fi
19001905
1901- # Test: worker-phase done phase 0 → next returns phase 1
1906+ # Test: worker-phase done phase 1 → next returns phase 2
19021907wph_next1=" $wph_next "
1903- $FLOWCTL worker-phase done --task " ${EPIC_PH} .1" --phase 0 --json > /dev/null
1908+ $FLOWCTL worker-phase done --task " ${EPIC_PH} .1" --phase 1 --json > /dev/null
19041909wph_next1b=" $( $FLOWCTL worker-phase next --task " ${EPIC_PH} .1" --json) "
19051910wph_phase1b=" $( echo " $wph_next1b " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin)["phase"])' ) "
1906- if [[ " $wph_phase1b " == " 1 " ]]; then
1907- echo -e " ${GREEN} ✓${NC} worker-phase done→next: advances to phase 1 "
1911+ if [[ " $wph_phase1b " == " 2 " ]]; then
1912+ echo -e " ${GREEN} ✓${NC} worker-phase done→next: advances to phase 2 "
19081913 PASS=$(( PASS + 1 ))
19091914else
1910- echo -e " ${RED} ✗${NC} worker-phase done→next: expected phase=2, got $wph_phase2 "
1915+ echo -e " ${RED} ✗${NC} worker-phase done→next: expected phase=2, got $wph_phase1b "
19111916 FAIL=$(( FAIL + 1 ))
19121917fi
19131918
1914- # Advance through phase 1 and 2 to test 2.5
1915- $FLOWCTL worker-phase done --task " ${EPIC_PH} .1" --phase 1 --json > /dev/null
1919+ # Advance through phase 2 and 5 to test 6
19161920$FLOWCTL worker-phase done --task " ${EPIC_PH} .1" --phase 2 --json > /dev/null
1917- wph_next2_5=" $( $FLOWCTL worker-phase next --task " ${EPIC_PH} .1" --json) "
1918- wph_phase2_5=" $( echo " $wph_next2_5 " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin)["phase"])' ) "
1919- if [[ " $wph_phase2_5 " == " 2.5" ]]; then
1920- echo -e " ${GREEN} ✓${NC} worker-phase done→next: advances to phase 2.5"
1921+ $FLOWCTL worker-phase done --task " ${EPIC_PH} .1" --phase 5 --json > /dev/null
1922+ wph_next6=" $( $FLOWCTL worker-phase next --task " ${EPIC_PH} .1" --json) "
1923+ wph_phase6=" $( echo " $wph_next6 " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin)["phase"])' ) "
1924+ if [[ " $wph_phase6 " == " 6" ]]; then
1925+ echo -e " ${GREEN} ✓${NC} worker-phase done→next: advances to phase 6"
19211926 PASS=$(( PASS + 1 ))
19221927else
1923- echo -e " ${RED} ✗${NC} worker-phase done→next: expected phase=2.5 , got $wph_phase2_5 "
1928+ echo -e " ${RED} ✗${NC} worker-phase done→next: expected phase=6 , got $wph_phase6 "
19241929 FAIL=$(( FAIL + 1 ))
19251930fi
19261931
1927- # Test: worker-phase skip detection — try to complete phase 5 before phase 3
1928- wph_skip_err=" $( $FLOWCTL worker-phase done --task " ${EPIC_PH} .1" --phase 5 --json 2>&1 || true) "
1932+ # Test: worker-phase skip detection — try to complete phase 10 before phase 6
1933+ wph_skip_err=" $( $FLOWCTL worker-phase done --task " ${EPIC_PH} .1" --phase 10 --json 2>&1 || true) "
19291934if echo " $wph_skip_err " | " $PYTHON_BIN " -c ' import json,sys; d=json.load(sys.stdin); assert d.get("error") or not d.get("success")' 2> /dev/null; then
19301935 echo -e " ${GREEN} ✓${NC} worker-phase skip detection: rejects out-of-order phase"
19311936 PASS=$(( PASS + 1 ))
@@ -1934,24 +1939,24 @@ else
19341939 FAIL=$(( FAIL + 1 ))
19351940fi
19361941
1937- # Test: worker-phase next returns non-empty content field
1938- wph_content_len =" $( echo " $wph_next1 " | " $PYTHON_BIN " -c ' import json,sys; print(len( json.load(sys.stdin).get ("content","")) )' ) "
1939- if [[ " $wph_content_len " -gt 0 ]]; then
1940- echo -e " ${GREEN} ✓${NC} worker-phase next: content field is non-empty ( $wph_content_len chars) "
1942+ # Test: worker-phase next returns content field (may be empty in streamlined mode)
1943+ wph_has_content =" $( echo " $wph_next1 " | " $PYTHON_BIN " -c ' import json,sys; d= json.load(sys.stdin); print ("content" in d )' ) "
1944+ if [[ " $wph_has_content " == " True " ]]; then
1945+ echo -e " ${GREEN} ✓${NC} worker-phase next: content field present "
19411946 PASS=$(( PASS + 1 ))
19421947else
1943- echo -e " ${RED} ✗${NC} worker-phase next: content field is empty "
1948+ echo -e " ${RED} ✗${NC} worker-phase next: content field missing "
19441949 FAIL=$(( FAIL + 1 ))
19451950fi
19461951
1947- # Test: worker-phase next returns different content for different phases (phase 0 vs phase 1 )
1948- wph_content_p0 =" $( echo " $wph_next1 " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin).get("content ","")[:50] )' ) "
1949- wph_content_p1 =" $( echo " $wph_next1b " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin).get("content ","")[:50] )' ) "
1950- if [[ " $wph_content_p0 " != " $wph_content_p1 " ]] && [[ -n " $wph_content_p1 " ]]; then
1951- echo -e " ${GREEN} ✓${NC} worker-phase next: content changes between phases (0 vs 1 )"
1952+ # Test: worker-phase next returns different titles for different phases (phase 1 vs phase 2 )
1953+ wph_title_p1 =" $( echo " $wph_next1 " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin).get("title ",""))' ) "
1954+ wph_title_p2 =" $( echo " $wph_next1b " | " $PYTHON_BIN " -c ' import json,sys; print(json.load(sys.stdin).get("title ",""))' ) "
1955+ if [[ " $wph_title_p1 " != " $wph_title_p2 " ]] && [[ -n " $wph_title_p2 " ]]; then
1956+ echo -e " ${GREEN} ✓${NC} worker-phase next: title changes between phases (1 vs 2 )"
19521957 PASS=$(( PASS + 1 ))
19531958else
1954- echo -e " ${RED} ✗${NC} worker-phase next: expected different content for phase 0 vs 1 "
1959+ echo -e " ${RED} ✗${NC} worker-phase next: expected different title for phase 1 vs 2 "
19551960 FAIL=$(( FAIL + 1 ))
19561961fi
19571962
@@ -1968,8 +1973,8 @@ else
19681973fi
19691974
19701975# Test: complete all remaining default phases → all_done
1971- # Phases 0, 1, 2 already done above; complete remaining: 2.5, 3, 5, 6
1972- for phase in 2.5 3 5 6 ; do
1976+ # Phases 1, 2, 5 already done above; complete remaining: 6, 7, 9, 10, 11, 12
1977+ for phase in 6 7 9 10 11 12 ; do
19731978 $FLOWCTL worker-phase done --task " ${EPIC_PH} .1" --phase " $phase " --json > /dev/null
19741979done
19751980wph_final=" $( $FLOWCTL worker-phase next --task " ${EPIC_PH} .1" --json) "
0 commit comments