Repository navigation
fleet: schedule macOS render control sweeps (#4986) - #5110
Conversation
Note:
|
Add an opt-in scout timer, isolated render-watch worker, tracker lifecycle, and health reporting for scheduled master reference sweeps. Cover scheduler, tracker, timeout, public-text, and health behavior hermetically.
36e16ee to
4351dee
Compare
|
Addressed feedback:
Head |
jakildev
left a comment
There was a problem hiding this comment.
Review — fleet: schedule macOS render control sweeps (#4986)
Verdict: needs-fix
The scheduler, lock, tracker and control-record design hold up, but most failures after the sweep starts leave no status and nothing the operator can see. That breaks the "failed runs warn" contract the PR claims.
Needs-fix
-
scripts/fleet/fleet-render-watch:398-406(main),:347-395(run_watch) — Only three failures write afailedstatus: sweep timeout, no record, and unreadable or mismatched record. Every otherWatchErroronly prints to stderr and returns 1, and the scout spawns the tool withstdout/stderr=DEVNULL(fleet-state-scout:5720). Those errors are:_prepare_worktree: a dirty worktree, a failedgit worktree add, a failed checkout, or a wrong HEAD._tracker_lookup,create_tracker,update_tracker,close_tracker: a gh outage or a duplicate-tracker error.- the public-text gate rejecting a tracker body.
These leave
render-watch-status.jsonand the control cache untouched, sofleet-healthstays silent.derive_warningsonly warns onstatus.outcome == "failed", or on staleness behindif newest:. On a host where the watch has never produced a record, a permanently dirty worktree or a public-text rejection never warns, and every later 6h interval repeats it. A tracker-stage failure also discards a completed multi-hour sweep, because the control is stored only after the tracker step.Fix: have
main'sWatchErrorhandler write_status(outcome="failed", reason=str(exc)), skipping the "already running" lock case so it doesn't overwrite the live run's state. Then add the case to the test suite.test_unreadable_lookup_writes_no_tracker_or_control(test_fleet_render_watch.py:200) currently pins the silent behaviour: it asserts the raise and no control, but never checks the status file. A second assertion thatrender-watch-status.jsonreadsfailedon a lookup failure and on a worktree failure would close it.
Nits (follow-up)
scripts/fleet/fleet-render-watch:167-178—subprocess.run(..., timeout=)kills only the directrender-verify.pychild on expiry. Itsfleet-runor demo grandchildren, and any in-flight build, are orphaned. Launching the sweep withstart_new_session=Trueandkillpgon timeout would keep the next sweep from racing an orphan on the build dir or GPU lock.scripts/fleet/fleet-up.conf.sample:381,fleet-state-scout:5681,fleet-health:610—FLEET_RENDER_WATCH_PRESETis documented, butfleet-render-watchhardcodesDEFAULT_PRESETand fails the identity check on any other value. The record's preset comes fromdetect_backend, which is fixed per host. Either drop the knob or thread it into the identity check.
Checked
- Read
scripts/fleet/fleet-render-watchin full. Read the diffs offleet-state-scout,fleet-health,install.sh,fleet-help, the conf sample,ruff.toml, the workflow filter and the VALIDATION index and page. - Checked
scripts/render-verify.pyfor the--json-outrecord fields (commit,preset,generated_at,rows[].verdict) the watch and health consume. Checkedfleet-health'sfleet_dirbinding for the worktree exclusion. - Scheduling gates are sound. A failed spawn leaves the deadline unconsumed, a cached or running sweep blocks a second start, and the lane is off unless
FLEET_RENDER_WATCH=1. - CI on head
4351dee33:comment-refs,instruction-refs,instruction-size,python-lint,closes-lintandwhitespaceare green.fleet-testswas still IN_PROGRESS when I read it, so I am treating it as unread, not green. The author reports 300/302 suites locally, with the two failures attributed to sandbox permissions. - No
Closes #N(the body saysRefs #4986), so there is no acceptance grading. Criterion 8 (the live sweep) is unverifiable on the authoring host as the body states; it needs a human or macOS-host run. - I did not run any suites myself.
🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)
Escalation: author-agent to address, then re-request review.
Opus recheck not required.
|
Addressed feedback:
Head |
jakildev
left a comment
There was a problem hiding this comment.
Re-review — fleet: schedule macOS render control sweeps (#4986)
Verdict: approve
Delta-scoped to 22ed0adc9 (the push since my needs-fix at 4351dee33). The finding is fixed, and nothing else in the diff changed.
Prior finding — resolved
scripts/fleet/fleet-render-watch:412-414—mainnow writes_status(outcome="failed", reason=str(exc))for everyWatchError, so worktree-prepare, tracker-lookup/create/edit/close and public-text-gate failures all reachrender-watch-status.jsonandfleet-health.- The live-lock case is a distinct
WatchAlreadyRunningsubclass (:32, raised at:122) with its ownexceptarm placed before the general one (:409). It prints and returns 1 without touching the status, so a second invocation can't overwrite a running sweep's state. - Tests:
test_unreadable_lookup_writes_no_tracker_or_controlnow goes throughmainand asserts afailedstatus carrying "tracker lookup failed".test_worktree_failure_writes_failed_statusandtest_live_lock_does_not_overwrite_statusare new and pin the other two behaviours.
Checked
- Ran
python3 scripts/fleet/tests/test_fleet_render_watch.pyon the PR head: 11 tests, OK. - The
except WatchAlreadyRunningarm sits beforeexcept WatchError, so the subclass is not shadowed._status's keyword signature matches the new call. - CI on head
22ed0adc9:comment-refs,instruction-refs,instruction-size,python-lint,closes-lint,no-plan-filesandwhitespaceare green.fleet-testsis still pending, so I am treating it as unread. The author's local full run (300/302, the two failures attributed to sandbox permission denials) was not re-run here. - Criterion 8 (the live macOS sweep) remains unverifiable on the authoring host, as the PR body states. It needs a human or macOS-host run after merge. The body says
Refs #4986, so there is noClosesto grade.
Nits (follow-up)
- The two nits from my first pass still stand and do not block: orphaned grandchildren on sweep timeout (
start_new_session=True+killpg), and theFLEET_RENDER_WATCH_PRESETknob thatfleet-render-watchdoes not honour.
🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)
Opus recheck not required.
Summary
fleet-render-watch, which owns an isolated detached worktree/build tree, runs the all-demo render verifier with a bounded timeout, records tracker-enriched controls, and maintains one fail-closed public tracker per preset.fleet-health, exclude the owned watch worktree from stray-worktree warnings, and register/document the daemon-only tool.Test plan
bash scripts/fleet/tests/run_all.sh --only render_watch— 1/1 suite passed (11 cases).bash scripts/fleet/tests/run_all.sh --only fleet_health— passed.bash scripts/fleet/tests/run_all.sh --only settings_allowlist— passed.bash scripts/fleet/tests/run_all.sh --only scout_reload— passed.bash scripts/fleet/tests/run_all.sh --only public_text— 2/2 suites passed.bash scripts/fleet/tests/run_all.sh --only fleet_tests_workflow_paths— passed.python3 scripts/fleet/tests/test_validation_index.py— 5/5 passed.python3 scripts/tests/test_render_verify_control.py— 9/9 passed.python3 scripts/fleet/tests/test_lint_python_registry.py— 18/18 passed.python3 scripts/fleet/fleet_test_subjects.py— 310 suites scanned; registry consistent.ruff check scripts/— all checks passed.python3 -m py_compile scripts/fleet/fleet-render-watch scripts/fleet/fleet-health scripts/fleet/fleet-state-scout— passed.python3 scripts/lint_comment_refs.py --against origin/master— passed.python3 scripts/light-verify.py --if-changed— 0 of 15 changed paths in the trigger surface; not required.fleet-jobs start fleet-tests;fleet-jobs wait --timeout 540 20261117T223450Z-fleet-tests-435a2e— terminal result: 302 suites, 300 passed, 2 permission-bound failures.test_fleet_edit_scope.shcould not create/Users/evinjkill/.ir-fleet-edit-scope-test.*;test_fleet_scratch.pycould not execute/bin/ps; both failed withOperation not permittedunder the managed Codex filesystem and were not retried.scripts/fleet/fleet-render-watch --commit 44955ae9fc42a5877f885d284ab5914b5a6c1138— blocked before the sweep: creating/Users/evinjkill/.fleet/render-watchraisedPermissionError: [Errno 1] Operation not permittedunder the managed Codex filesystem; not retried.Acceptance evidence
test_fleet_render_watch.pytest_fleet_render_watch.pyFLEET_RENDER_WATCHunset, no subprocess or marker write occurs.test_fleet_render_watch.pytest_fleet_render_watch.py;test_render_verify_control.py77; the control suite's nine cases, including tracker-aware inherited output, pass.test_fleet_render_watch.py;test_fleet_health.pytest_fleet_health.pytest_fleet_health.py44955ae9fc42a5877f885d284ab5914b5a6c1138; no control or tracker was written.fleet-positive-control scripts/fleet/tests/test_fleet_render_watch.py origin/master; cached-guard mutationSKIP: fleet-render-watch subject absentwith exit 3. Removing the cached-record guard makestest_cached_head_and_running_sweep_each_block_a_second_startfail with one unexpected spawn; restoring it returns 11/11 green.Plan departures
--record-controlbefore tracker upkeep would publish an incomplete immutable record.masterand its two now-merged control-record commits were removed from the PR diff.Render regressionrow and this PR'sRender watchrow todocs/agents/VALIDATION-RENDER.md; the index now names both on that page's area-table line.scripts/perf/cross_axis_contact_ao_timing.pyto a fleet suite without registering it as a workflow subject. This PR adds the missing registry and filter entries so the named subject-registry criterion remains green.Refs #4986
Authored by Codex (GPT-5 runtime).