Repository navigation
Count finished groups from each host's database; keep hosts holding unconsolidated work (#347) - #352
Merged
NewGraphEnvironment merged 11 commits intoOct 18, 2026
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
…nsolidated work (#347) New data-raw/study_area_hosts.sh: host_finished reads <schema>.log for the run_uid (date_end set), framed by sentinels so an unreachable host is unknown rather than empty; host_log_reported matches markers anywhere on a line (diagnosis and SKIP only); burn_cyphers burns only hosts not held and records every kept host in ${TS}_kept_hosts.tsv. Tests run the lib in bash with stubbed ssh/psql/tofu/doctl and a mock cypher_down.sh; five mutants, all caught. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Completeness reads each host's database; consolidate takes database plus
log-done groups and leaves out a host whose database did not answer. A
cypher is held from dispatch and released only when its session exited 0
and, after consolidate, no streams rows are left on it for any group it ran
or finished. Held and failed-burn hosts are listed in ${TS}_kept_hosts.tsv
and the run exits non-zero. CYPHERS_UP is set before the spin so a failed
spin cannot leak droplets, and pre-flight fails on a cypher already up in
this run's workspaces.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Every group's log carried an 'incomplete final line' warning from this file. config_hash moves for each bundle; it is provenance, not a gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
#347) From /code-check round 1. The kept-hosts file listed groups consolidate had already taken, and recovering them would have deleted the dispatcher's copy. --keep-cyphers no longer hides a host held for cause. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
From /code-check round 2. A group that failed after the pre-persist leaves streams rows; it was listed for recovery, which would have replaced the dispatcher's copy with a broken one, and it held the host forever. Finished now means database, log done, or streams_mapping_code rows (final persist only); partial groups neither hold the host nor appear in the recover list. Recovery now ends with a recompute. The lib declares every map it uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
#347) From /code-check round 3. A host whose session has not ended 0 is unsettled: its unfinished groups may still be building, so they are never called partial. The recovery text says whether the recompute ran. A pre-dispatch baseline keeps an image's mapping-code rows from counting as this run's; with no baseline they hold the host and are never recovered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
…'s signals (#347) From /code-check round 4's enumeration. A driver killed while waiting on a host saw it settled; a trap report before accounting had no finish signals; the baseline missed an image's mapping-code rows. A group with rows from before dispatch and no finish signal is now unknown, never partial. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
… cause (#347) From /code-check round 5. A driver killed during consolidate recorded groups that consolidate was about to remove from the host. The two writes the driver makes to a cypher after dispatch (the dispatch session and schema_consolidate) are now both covered by the settledness rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
NewGraphEnvironment
deleted the
347-study-area-run-sh-counts-finished-groups
branch
October 18, 2026 02:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
study_area_run.shused to count[wsg_run_one] <WSG> donelines anchored at line start. In run20261017_004619-3f4c713ban R warning flushed without a newline put the marker mid-line on 18 finished groups, so the driver left them out of consolidate and would have burned the only copy (study_area_run.sh counts finished groups from log text and burns hosts holding unconsolidated work #347).<schema>.logrows for the run_uid withdate_endset, read over the routeschema_consolidate.Ruses (ssh→docker exec -i fresh-db psql). Output is framed by sentinels: no sentinels means unknown, never "nothing", because ssh can exit 0 whatever the remote command did.done, because.lnk_log_run_finish()is a soft UPDATE after persist and a lostLNK_RUN_UIDleavesrun_uidNULL.SKIPcomes from the log alone; it writes no row.waitreturns, and consolidate is not running) and, after consolidate, its database holds no group this run finished. consolidate deletes what it copied from the source, so this measures what was not consolidated.done, orstreams_mapping_coderows, which within a run only the final persist writes), partial (a group that failed after the pre-persist: never consolidated, does not hold the host), and unknown (rows that were there before dispatch, per a pre-dispatch baseline, or mapping-code rows with no baseline: they hold the host and are never recovered). On an unsettled host nothing is called partial.<TS>_kept_hosts.tsv: reason, run_uid, schema, the three group sets, whether they were measured, and the commands that print the address and burn the host. The banner prints from the EXIT trap and says whether the recompute ran, and the run exits non-zero.--keep-cyphersalone is not a failure; a host it keeps for cause still is.CYPHERS_UPis set before the spin, so a failed spin of one workspace no longer exits with the others' droplets unburned.incomplete final linewarning is gone from every group's log:cabd_blkey_xref.csvends with a newline in all four bundles. Each bundle'sconfig_hashmoves (provenance, by operator call).Evidence
tests/testthat/test-study_area_hosts.R: 120 expectations, run in bash ≥ 4 with stubbed ssh / psql / tofu / doctl and a mockcypher_down.sh. They include:donemarker mid-line reports complete;They skip when
data-raw/is absent (R CMD check), and fail rather than skip without bash ≥ 4.26 mutants of the lib, each caught. The issue's "restore the anchored match", read as counting from the log with main's
sed, fails 9 tests, including the mid-line fixture.Live, local fwapg:
20261017_004619-3f4c713b;--preflight-onlyrun sources the lib and passes the doctl and droplet legs.The ssh leg to a live cypher was not run (it needs a paid spin).
devtools::test(): 3058 pass, 5 fail, none from this branch. Three need the:63333tunnel, which was down; two are the golden dams count, which fails the same on cleanmain.Review: a plan review and five
/code-checkrounds, 13 findings fixed. Every round from 2 on found a defect inside the previous fix, all one mechanism: a label on observed rows needs provenance and settledness. The loop ended by enumerating both (the two writers to a cypher after dispatch, the two sources of its rows, every printed label), not on a quiet round. Records are inplanning/archive/2026-10-issue-347-host-completeness-db/.Fixes #347.
Relates to NewGraphEnvironment/sred#24
🤖 Generated with Claude Code
https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx