Skip to content

Commit e7c744c

Browse files
committed
feat: add durable dual-mode loop runtime
1 parent 215a2a3 commit e7c744c

20 files changed

Lines changed: 2725 additions & 476 deletions

.github/workflows/python-compat.yml

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,60 @@ jobs:
4444
set -euo pipefail
4545
tmpdir="$(mktemp -d)"
4646
state_path="$tmpdir/.codex-loop/state.json"
47+
marker_path="$tmpdir/done.txt"
4748
4849
python scripts/init_state.py \
4950
--state "$state_path" \
5051
--goal "Verify compatibility smoke test" \
51-
--global-stop-condition "Stop only when the lifecycle scripts run cleanly." \
52+
--global-stop-condition "Stop only when the lifecycle scripts run cleanly and done.txt contains done." \
5253
--workspace-root "$tmpdir" \
53-
--success-evidence "check_stop.py returns success"
54+
--success-evidence "check_stop.py returns success" \
55+
--require-path done.txt \
56+
--require-text "done.txt::done"
57+
58+
python scripts/append_event.py \
59+
--state "$state_path" \
60+
--kind round.started \
61+
--message "Compatibility smoke iteration 1 announced" \
62+
--data iteration=1 \
63+
--data task="record first lifecycle iteration" \
64+
--data local_done_condition="first verified round is persisted" \
65+
--data global_stop_condition="lifecycle scripts run and done.txt contains done" \
66+
--data stop_after_this_round="machine stop checks pass"
5467
5568
python scripts/update_state.py \
5669
--state "$state_path" \
57-
--task "Record a smoke-test iteration" \
70+
--task "Record the first smoke-test iteration" \
5871
--local-done-condition "A verified iteration is appended" \
59-
--result-summary "The iteration was written successfully" \
72+
--result-summary "The first iteration was written successfully" \
6073
--verification-summary "Validated by reading the updated state file" \
61-
--next-task "Mark the loop complete" \
74+
--announcement "Iteration 1: record the first smoke-test iteration" \
75+
--next-task "Create the success marker and finalize the loop" \
6276
--agent-id "compat-smoke-executor" \
6377
--executor-inherited-context
6478
79+
printf 'done\n' > "$marker_path"
80+
6581
python scripts/update_state.py \
6682
--state "$state_path" \
67-
--task "Mark the loop complete" \
68-
--local-done-condition "The global stop condition is marked as met" \
69-
--result-summary "The loop was marked completed" \
70-
--verification-summary "Validated by check_stop.py" \
83+
--task "Create the success marker and finalize the loop" \
84+
--local-done-condition "done.txt exists and contains done" \
85+
--result-summary "The lifecycle smoke marker was created and the loop was marked completed" \
86+
--verification-summary "Validated by reading done.txt and re-running check_stop.py" \
87+
--announcement "Iteration 2: create the success marker and finalize the loop" \
88+
--artifact "$marker_path" \
89+
--evidence "$marker_path" \
7190
--stop-met
7291
7392
python scripts/check_stop.py --state "$state_path"
93+
python scripts/report_status.py --state "$state_path" --label compat.smoke
7494
python scripts/compact_state.py --state "$state_path" --keep-last 1
95+
96+
test -f "$tmpdir/.codex-loop/events.jsonl"
97+
test -f "$tmpdir/.codex-loop/iterations.jsonl"
98+
test -f "$tmpdir/.codex-loop/status-history.jsonl"
99+
test -f "$tmpdir/.codex-loop/latest-status.txt"
100+
test -f "$tmpdir/.codex-loop/latest-stop-report.json"
101+
test -f "$tmpdir/.codex-loop/run-summary.md"
102+
test -f "$tmpdir/.codex-loop/rounds/iteration-0001.md"
103+
test -f "$tmpdir/.codex-loop/rounds/iteration-0002.md"

0 commit comments

Comments
 (0)