From ad74c8a39ecf48ab7f4aa844013c7efc6c5019c7 Mon Sep 17 00:00:00 2001 From: kami Date: Sat, 29 Aug 2026 16:39:22 +0400 Subject: [PATCH 1/2] orchestra: TASK.md --- TASK.md | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/TASK.md b/TASK.md index cb2bf31..4096999 100644 --- a/TASK.md +++ b/TASK.md @@ -1,18 +1,47 @@ -# Task 06G4JX6MSQEP7N0D5JWW9EP5X4 +# Task 06G4V20T528ZTER7KZBVGNAYXC -Late handoff rig: add a --version line to the healthcheck usage text +Give the healthcheck a --timing flag, in five sequential phases - Project: test-e2e -- Source: burnin/late-handoff-1 +- Source: burnin/run17-implement-successor-and-f62 - Priority: 0 ## Instructions -Add the version string to the usage text printed by scripts/orchestra_e2e_healthcheck.sh --help. Keep every existing line and exit status unchanged, and keep scripts/test_healthcheck.sh passing. +Add a --timing flag to scripts/orchestra_e2e_healthcheck.sh that reports how long each check took, and extend the self-test to cover it. + +Plan this as FIVE phases. Each phase is independently verifiable and must be implemented and verified on its own: + +1. Record a monotonic start time at the top of main() and a helper that returns elapsed milliseconds. No change to any existing output or exit status. +2. Record a per-check elapsed value as each check runs, stored alongside the existing result state. Still no output change. +3. Add the --timing flag. It prints one line per check with its elapsed milliseconds, then the existing success line. +4. Make --timing compose with --quiet and --json: --quiet suppresses the timing lines, --json emits the timings inside the existing JSON object. +5. Update the usage text in --help and extend scripts/test_healthcheck.sh with assertions for --timing, --timing --quiet, and --timing --json. + +## Work one phase at a time + +This is a hard requirement of this task, not a style preference. Implement phase N, request its verification, and only then begin phase N+1. Do not write the whole change first and verify the phases afterwards. + +## Verification policy for this project + +Only two commands may appear on a run: line, exactly: + +- ["bash", "-n", ""] +- ["bash", "scripts/orchestra_e2e_healthcheck.sh"] + +Anything else is refused when you seal the plan. Give every phase at least one automated check from that list, and add a manual check where a human should confirm the printed text. ## Research first -Establish at least three findings with distinct confidence: at least one `fact`, one `inference`, one `assumption`. +Establish at least three findings with distinct confidence: at least one fact, one inference, one assumption. + +## Rotation rig, phases 4 and 5 + +This task is also a rig for Orchestra's rotation protocol, so its handoff behaviour is deliberately split. + +During phases 1 to 3, behave normally: if Orchestra asks you to write a handoff report, write it and stop. + +From the moment phase 4 begins, do the opposite. If Orchestra asks you to write a handoff report, DO NOT write it, and do not stop the session. Acknowledge nothing, write no report file, and simply remain idle at the prompt. Orchestra is measuring what it does when an agent never answers a handoff request, and an answer here would defeat the measurement. This instruction applies only to phases 4 and 5 of this task. ## Quality gate From 82c944728e82c4049c51fe09bd73448db3f41fd7 Mon Sep 17 00:00:00 2001 From: kami Date: Sat, 29 Aug 2026 17:01:49 +0400 Subject: [PATCH 2/2] orchestra: complete 06G4V20T528ZTER7KZBVGNAYXC --- scripts/orchestra_e2e_healthcheck.sh | 34 ++++++++++++++++++++++++++-- scripts/test_healthcheck.sh | 11 ++++++--- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/scripts/orchestra_e2e_healthcheck.sh b/scripts/orchestra_e2e_healthcheck.sh index f7b9a38..3f8836e 100755 --- a/scripts/orchestra_e2e_healthcheck.sh +++ b/scripts/orchestra_e2e_healthcheck.sh @@ -11,21 +11,33 @@ emit() { [ "$format" = none ] || printf "$@" } +# now_us: current time in microseconds. Strips any locale decimal separator. +now_us() { printf '%s' "${EPOCHREALTIME//[!0-9]/}"; } + +# elapsed_ms : whole milliseconds since . +elapsed_ms() { printf '%s' "$(( ($(now_us) - $1) / 1000 ))"; } + main() { + local start_us + start_us=$(now_us) local quiet= local json= + local timing= for arg in "$@"; do if [ "$arg" = --help ]; then - emit text 'Usage: %s [--quiet]\n\n' "${0##*/}" + emit text 'Usage: %s [--quiet] [--json] [--timing]\n\n' "${0##*/}" emit text 'Healthcheck script for Orchestra E2E tests.\n' emit text 'Exits 0 with a success message if all checks pass.\n' emit text ' --quiet Suppress the success message; still exits 0.\n' + emit text ' --timing Print elapsed milliseconds for each check.\n' emit text 'Version: %s\n' "$VERSION" exit 0 elif [ "$arg" = --quiet ]; then quiet=1 elif [ "$arg" = --json ]; then json=1 + elif [ "$arg" = --timing ]; then + timing=1 fi done @@ -33,11 +45,29 @@ main() { [ -n "$quiet" ] && format=none [ -n "$json" ] && format=json + local -a TIMINGS=() + TIMINGS+=("healthchecks=$(elapsed_ms "$start_us")") + if [ "$format" = json ]; then - emit "$format" '{"status":"ok","checks":1}\n' + local timings= + if [ -n "$timing" ]; then + local sep= + for t in "${TIMINGS[@]}"; do + timings+="$sep\"${t%%=*}\":${t#*=}" + sep=, + done + timings=",\"timings\":{$timings}" + fi + emit "$format" '{"status":"ok","checks":%d%s}\n' "${#TIMINGS[@]}" "$timings" exit 0 fi + if [ -n "$timing" ]; then + for t in "${TIMINGS[@]}"; do + emit "$format" '%s: %sms\n' "${t%%=*}" "${t#*=}" + done + fi + emit "$format" 'OK - all healthchecks passed\n' exit 0 } diff --git a/scripts/test_healthcheck.sh b/scripts/test_healthcheck.sh index 71193f9..6dfe0fe 100755 --- a/scripts/test_healthcheck.sh +++ b/scripts/test_healthcheck.sh @@ -3,14 +3,16 @@ HC="$(dirname "$0")/orchestra_e2e_healthcheck.sh" OK='OK - all healthchecks passed' -USAGE="$(printf 'Usage: orchestra_e2e_healthcheck.sh [--quiet]\n\nHealthcheck script for Orchestra E2E tests.\nExits 0 with a success message if all checks pass.\n --quiet Suppress the success message; still exits 0.\nVersion: 1.0.0')" +USAGE="$(printf 'Usage: orchestra_e2e_healthcheck.sh [--quiet] [--json] [--timing]\n\nHealthcheck script for Orchestra E2E tests.\nExits 0 with a success message if all checks pass.\n --quiet Suppress the success message; still exits 0.\n --timing Print elapsed milliseconds for each check.\nVersion: 1.0.0')" fails=0 check() { # check