Commit Graph
549 Commits
Author SHA1 Message Date
Joseph Magly 4a285a0484 fix(persistence): settle uncertain hard-link publishes by file identity
Grok review r1 for #682: after a hard-link error that may have succeeded,
_publish_file_no_replace compares the destination's (st_dev, st_ino) with the
temp file's before renaming: the same file counts as published by this write,
a different file is a definite FileExistsError, and only an incomparable
identity stays uncertain. The uncertain-link test is platform-correct (on
Windows a rename onto the write's own link publishes normally). Windows
winerror 1/50 (no hard links) is a definite link failure. Adds tests for a
link that took effect despite EIO, a foreign file after EIO, and a definite
link error followed by an existing destination.
2026-11-25 15:35:23 -05:00
Joseph Magly 5cebcf19c2 Merge main b7113e6 into fix/675-e-persistence-notes 2026-11-25 14:44:12 -05:00
Joseph Magly 285618db15 fix(persistence): keep refusal causes and report uncertain hard-link publishes
Section E of #675: both rollback-refusal re-raise paths keep the refusal's
own cause in one chain (a refusal with no cause gets the commit error); a
hard link that errored uncertainly, followed by an EEXIST or unsupported
fallback rename, is reported as possibly published by this write rather than
"Output already exists"; a definite link failure with no rename says nothing
was published. CHANGELOG wrapping and the Windows staging residual note are
fixed. Directory os.open and unknown-~user tests are gated by capability and
platform, and the ArchiveRootError docstring names expanduser/Path.home.

Refs #675
2026-11-25 14:44:10 -05:00
Joseph Magly 820af1426d Merge main e4ac974 into fix/675-a-recipe-diagnostics 2026-11-25 13:33:06 -05:00
Joseph Magly e2e7e30799 fix(recipes): make cleanup diagnostics best effort without stdout fallback or duplicates
Section A of #675: with stderr None, diagnostics are dropped instead of going to stdout; a failed flush never re-prints the line; recipe search/confirm keep exit 4 (no traceback) when stderr is closed or missing; docstrings say never raises an Exception / best effort; the contended-write test requires a failing print and the unencodable case asserts the refusal and CRITICAL lines.

Refs #675
2026-11-25 13:33:04 -05:00
Joseph Magly 4e1209e61e Merge main 11b2247 into fix/669-modelhandle-cleanup-followups
# Conflicts:
#	CHANGELOG.md
2026-11-25 12:53:38 -05:00
Joseph Magly a1959fd163 Merge main 38d3792 into fix/669-modelhandle-cleanup-followups
# Conflicts:
#	CHANGELOG.md
2026-11-25 12:23:02 -05:00
Joseph Magly b45cd77155 Merge main 38d3792 into fix/665-vocab-offload-followups
# Conflicts:
#	CHANGELOG.md
2026-11-25 12:03:55 -05:00
Joseph Magly 5c9042c807 Merge main 4898d06 into fix/665-vocab-offload-followups
# Conflicts:
#	CHANGELOG.md
2026-11-25 11:21:58 -05:00
Joseph Magly 4793e96f34 fix(vocab,offload): walk to the nearest flag-carrying tie owner; coalesce and propagate unavailable compares
_config_tie_flag lets a silent sub-model owner defer to the next enclosing
owner that declares tie_word_embeddings; the top level decides only when all
are silent (any-True across alias paths and fail-closed disagreement kept).
logical_values_identical batches narrow leading-index slices up to the chunk
budget and propagates None from recursion instead of folding it into False.
Docs: apply_all also verifies ID-only operations via a matching embedded
config pin.

Refs #665
2026-11-25 11:21:56 -05:00
Joseph Magly 312a5ae329 Merge main 4898d06 into fix/669-modelhandle-cleanup-followups
# Conflicts:
#	CHANGELOG.md
2026-11-25 11:21:48 -05:00
Joseph Magly 0030a32ccc Merge main 4898d06 into fix/644-645-checkpoint-rollback-capacity
# Conflicts:
#	CHANGELOG.md
2026-11-25 11:21:02 -05:00
Joseph Magly 4898d068d9 Merge pull request #670 from elder-plinius/fix/666-viewer-evaluator-preset-followups
fix(viewer,evaluator,presets): close #661/#663 review follow-ups
2026-11-25 11:15:54 -05:00
Joseph Magly 4ad55a64d1 Merge pull request #660 from elder-plinius/fix/652-654-recipe-cleanup-followups
fix(recipes): bound the cleanup-lock wait and keep cleanup failures primary over any close error
2026-11-25 11:11:05 -05:00
Joseph Magly 3c7a6ca920 fix(models): harden ModelHandle cleanup sites and messages
Moves cleanup_on_exit/cleanup_during_error to the light
obliteratus.handle_cleanup module (re-exported from the loader) and imports
them at module top, so no import runs after a handle exists. Stores the closed
policy before detaching the restore point, names the path to remove in
handle-surfaced SnapshotErrors, guards post-load work in candidate,
smaller_change and the sequence loaders, keeps observer-close and neuron-lab
cleanup failures from replacing the primary error or skipping state reset, and
adds failure-plus-failing-close tests for every listed site.

Fixes #669
2026-11-25 10:06:29 -05:00
Joseph Magly 2a0abae1f8 fix(viewer,evaluator,presets): close #661/#663 review follow-ups
The results viewer formats -0 and non-finite values like Python, survives
engines without toFixed(100), and shows an error when readAsText throws. CSV
export writes an empty metric name as `metric:` and orders columns by name
across all rows. StudyConfig rejects `metrics: []` at parse. The evaluator logs
the position_ids fallback and matches more rejection wordings, runs in eval
mode (restoring module modes afterwards), and handles left padding in
classification. Preset getters return deep copies.

Fixes #666
2026-11-25 09:59:06 -05:00
Joseph Magly 1418c5109c Merge main dd7cef9 into fix/644-645-checkpoint-rollback-capacity
Keep both sides: #659's snapshot close tests and this branch's snapshot plan
tests in tests/test_model_snapshot.py, and both CHANGELOG entries.
2026-11-25 07:51:30 -05:00
Joseph Magly b8de31cd5a Merge main 2e31f24 into fix/644-645-checkpoint-rollback-capacity; address Muse audit
Muse BT6 audit of 3500f9d for #664: an identity with st_ino == 0 counts as no
identity (rollback refuses, and held-staging cleanup leaves the path) on
volumes without file IDs; the move-aside is a no-replace rename and a foreign
entry found after the move is moved straight back; on filesystems without
no-replace rename nothing moves, so the promoted checkpoint and the backup are
both kept. Review r2 P3s: accurate notes when the move-aside fails, the
staging path named when kept, and a CHANGELOG entry referencing #667.
2026-11-25 07:50:35 -05:00
Joseph Magly d56ab8eb2d Merge main 2e31f24 into fix/652-654-recipe-cleanup-followups; make lock diagnostics best-effort
Muse BT6 audit of f95dc6b for #660: every stderr diagnostic in the recipe
cleanup lock paths goes through _diagnostic(), which retries with non-ASCII
escaped and otherwise drops the line, so a closed or strict-encoding stderr
can no longer stop a lock wait or replace the ProcessCleanupFailed / exit 4
conversion.
2026-11-25 07:30:53 -05:00
Joseph Magly 0eaee59905 Merge main 2e31f24 into fix/639-640-651-modelhandle-followups
# Conflicts:
#	CHANGELOG.md
2026-11-25 07:19:04 -05:00
Joseph Magly 6ea20a0da7 Merge pull request #662 from elder-plinius/fix/632-638-cli-runs-followups
fix(cli): match distributed preflight guard to command position; narrow runs error handling
2026-11-25 07:02:32 -05:00
Joseph Magly f95dc6b481 Merge main 3a49e8e into fix/652-654-recipe-cleanup-followups; deliver signals after the lock wait
Review r2 for #660: the launch guard takes the run's signals and checks them
once it holds the cleanup lock and has checked the marker, before any launch,
reservation or guarded body, so a SIGINT/SIGTERM deferred during the bounded
wait releases the lock with nothing launched or reserved. Wired into the
search start check, the commit guard, the confirmation reservation and every
step launch; an exception before the guard yields counts as a refusal for
injected runners. The nested-lock test is bounded by a thread join, and an
interrupt during close is raised when no cleanup failure propagates.
2026-11-25 03:57:54 -05:00
Joseph Magly 3500f9dfe0 Merge main 3a49e8e into fix/644-645-checkpoint-rollback-capacity; address review r1
Sync with #658 (fd-held staging cleanup): staging cleanup keeps #658's held
handle plus the keep_staging condition, and rollback takes its identity from
the held staging handle. Review r1 fixes for #664: staging is marked possibly
foreign before the move-aside and cleared only on a positive identity check,
so a failing check or an interrupt keeps staging; the backup is restored with
the no-replace rename helper and kept if the destination is occupied or
no-replace is unsupported; on POSIX an unpinned identity is never recorded, so
rollback refuses. Docs call the plan's host figure a conservative upper bound.
2026-11-25 03:54:35 -05:00
Joseph Magly 686ebddac9 Merge main 3a49e8e into fix/639-640-651-modelhandle-followups 2026-11-25 03:47:21 -05:00
Joseph Magly c21275ae5f fix(models): never let snapshot cleanup replace an in-flight error; close interrupt windows
Muse review r1 and the Muse BT6 audit for #659: _close_restore_point stores a
plain closed/unavailable policy naming the snapshot path right after
detaching, and reports closed only after close() returns; DiskSnapshot.close()
marks the snapshot close_failed before removing anything, so an interrupted
removal can never leave a snapshot that is accepted again. New
cleanup_on_exit/cleanup_during_error helpers attach a cleanup failure as a
note while an error is propagating and raise it otherwise; every production
ModelHandle cleanup site in a finally or failure path uses them. Removal clears
Windows read-only bits once and reports a count and the first failing paths;
the entry-point test registers cleanup before summoning and checks its own
paths.
2026-11-25 03:47:19 -05:00
Joseph Magly ef0d8a269c Merge pull request #661 from elder-plinius/fix/648-650-results-viewer-followups
fix(reporting): namespace ablation CSV change columns and round viewer numbers half to even
2026-11-25 03:32:47 -05:00
Joseph Magly 2288aaa470 fix(recipes): keep the cleanup-lock holder hint from breaking the lock wait
Muse BT6 audit of 87598e3 for #660: _lock_holder returns the generic hint
unless the platform is Linux and catches any exception, so a Windows host (no
os.major/os.minor) or a failing /proc/locks read can no longer escape either
lock path. Adds tests for a context cycle on the close stack and for a nested
launch guard refused after the bounded wait; the docs describe both.
2026-11-25 03:21:31 -05:00
Joseph Magly 259bbf3645 fix(persistence,snapshot): prove ownership before checkpoint rollback; bound exact-check scratch in snapshot plans
Default checkpoint rollback only moves the directory it promoted, checked by
(st_dev, st_ino) pinned through a directory descriptor; otherwise it keeps the
backup and raises CheckpointRollbackRefused naming both paths. A cancellation
during or after a failed rollback is re-raised unchanged with the outcome as a
note. plan_snapshot() and capacity plans add a capped exact overlap-check
allowance when the layout is unknown, and the docs describe the plan as a
lower bound.

Fixes #644
Fixes #645
2026-11-25 02:58:43 -05:00
Joseph Magly ab3be343a9 fix(cli): match distributed preflight guard to command position; narrow runs error handling
Restrict the distributed+preflight shape guard to the command position so
launched arguments and option values containing both words are accepted.
Introduce RunArchiveError (keeping builtin bases) and catch only it in
`obliteratus runs`, so internal errors keep their traceback; corrupt
manifests report "invalid manifest". The secret-guard test checks stderr.

Fixes #632
Fixes #638
2026-11-25 02:47:23 -05:00
Joseph Magly 13e49f799a fix(reporting): namespace ablation CSV change columns and round viewer numbers half to even
Ablation CSV change columns are now delta:<metric> and pct_change:<metric>;
metrics whose names are reserved are written as metric:<name>, so no metric
can overwrite another column. The results viewer formats numbers half to even
like Python (12.25% shows as +12.2%), with tests for a stale read error after a
demo load and readAsText throwing; the report fallback comment says name order.

Fixes #648
Fixes #650
2026-11-25 02:46:38 -05:00
Joseph Magly 87598e3693 fix(recipes): bound the cleanup-lock wait and keep cleanup failures primary over any close error
Every wait for the recipe cleanup lock is capped at 60 s with stderr progress
naming the lock and, where available, the holder PID; a launch check that
times out is refused with exit 4 instead of hanging. cleanup_failure_first()
closes resources through a yielded ExitStack and attaches any close error,
including KeyboardInterrupt and SystemExit, as a note on a propagating cleanup
failure. An end-to-end test pins that a raw OSError from the evaluator's
normal-exit stop exits 4 with a marker.

Fixes #652
Fixes #654
2026-11-25 02:44:44 -05:00
Joseph Magly 5458b193a6 fix(models): report DiskSnapshot removal failures and close ModelHandle cleanup gaps
DiskSnapshot.close() stays retryable and raises SnapshotError when files
remain, and a cleanup failure no longer replaces an in-flight error; the
ModelHandle finalizer only logs. Interrupted cleanup names the still-owned
offload directory, the snapshot-policy read records unreadable falsy policies,
and the pipeline offload guard requires ownership `is True`. The entry-point
test closes its handles and checks TMPDIR for leftovers.

Fixes #639
Fixes #640
Fixes #651
2026-11-25 02:41:03 -05:00
Joseph Magly e2db84183f fix(persistence,vocab): fd-held staging cleanup, keep cancellations, guard apply_all, silent-owner tie flag
Staging cleanup now removes only the directory held open since creation, so a
directory recreated at the staging path is never deleted. Cancellations after
a no-replace rename stay cancellations, with the outcome as a note; an
interrupted discovery publish names the file as possibly published.
VocabSurgeryStrategy.apply_all enforces the ID-only tokenizer guard itself, a
silent alias owner defers to the top-level tie flag, and
logical_values_identical no longer reshapes non-rank-2 values.

Fixes #649
Fixes #655
2026-11-25 02:38:37 -05:00
Joseph Magly d4296aa8a5 Merge pull request #625 from elder-plinius/fix/622-process-group-followups
Bound the post-SIGKILL leader wait; restore non-Python signal handlers
2026-11-25 02:20:39 -05:00
Joseph Magly f5e7c84005 Merge pull request #623 from elder-plinius/fix/599-601-vocab-surgery-tie-budget
Enforce the vocabulary tie policy for offloaded weights; bound edit memory
2026-11-25 01:58:14 -05:00
Joseph Magly 4c28b193bd fix(recipes): record a release failure after any entered launch as a cleanup failure
Grok review r8 for #625: the launch guard records when its body is entered and
keeps the body's in-flight exception, so a lock-release failure after entry,
whether the body completed or raised, becomes a ProcessGroupCleanupError
chained from that exception with the OSError as a note. cleanup_failure_first
keeps the cleanup error's own context and follows only close-error chains; a
release failure after a durable marker write says the marker was recorded.
2026-11-24 23:32:27 -05:00
Joseph Magly 65a2d0f922 fix(process): keep cleanup failures through guard release, close errors and Windows vLLM stop
Codex review r7 and the Muse BT6 audit for #625: guard balance is recorded
before an abandoned guard is closed, and a release failure during that close
becomes a new cleanup failure chained to the runner's exception; any exception
raised while the guard is unbalanced is a fresh, unrecorded cleanup failure;
evaluator pipe and selector close errors are attached as notes instead of
replacing a cleanup failure; the non-POSIX vLLM stop terminates and kills the
process handle and treats survival or any stop error as a cleanup failure;
marker writes wait at most 60 s for the cleanup lock, then fail closed.
2026-11-24 22:58:49 -05:00
Joseph Magly 7228de99db fix(vocab-surgery): tie detection across head aliases and suffix forms; admit edit memory before reads
Muse review r1 for #623: the config tie check walks every path the head is
registered under (any owner config or its text config saying tied, or a
disagreement between paths, means tied); tie metadata is read as an
undirected link graph matched over every suffix form of every module path, so
cycles and suffix-form links are never read as untied; edit memory is
admitted from shape/dtype/placement before any offloaded value is read, then
again exactly before any edit allocation. The NaN-aware bounded comparison
moves to offload_surgery and is reused by adopt_tied_alias.
2026-11-24 22:43:54 -05:00
Joseph Magly 14db27413a fix(recipes): record cleanup failures on every platform and for raising runners
Muse review r6 for #625 and the Muse BT6 audit: search converts and records a
plain cleanup error before the non-POSIX re-raise and both recipe CLIs exit 4
on any ProcessGroupCleanupError; the injected-runner guard balance is checked
whether the runner returns or raises; a lock-release failure after launch,
a failed non-POSIX kill and a vLLM server surviving SIGKILL are cleanup
failures; confirmation's marker names the failing step's log; CHANGELOG
records exit 4, the marker and the launch_guard runner keyword.
2026-11-24 22:17:06 -05:00
Joseph Magly 018e833842 Merge main d737569 into fix/629-failed-run-cleanup-followups
# Conflicts:
#	CHANGELOG.md
2026-11-24 22:05:44 -05:00
Joseph Magly b97ef38efc Merge main d737569 into fix/599-601-vocab-surgery-tie-budget
# Conflicts:
#	tests/test_vocab_surgery.py
2026-11-24 22:01:39 -05:00
Joseph Magly b327db8c31 Merge main 5fe49fd into fix/622-process-group-followups 2026-11-24 21:26:04 -05:00
Joseph Magly 30a2fa65eb fix(process): treat every group stop failure and skipped launch guard as a cleanup failure
Codex/Muse review r5 for #625: any error stopping a step's process group,
after an interrupt or a normal exit with any code (including the evaluator's
normal-exit stop and VllmServer.stop), becomes a ProcessGroupCleanupError
chained to the original, so search and confirmation write the marker. A
skipped or unbalanced launch guard on any step raises a plain
ProcessGroupCleanupError so the marker is recorded and resume is refused.
Docs clarify the cooperative-runner trust boundary.
2026-11-24 21:26:02 -05:00
Joseph Magly 5fe49fdadc Merge pull request #618 from elder-plinius/fix/606-607-604-report-metrics
Preserve the study impact metric in reports and list only plots written
2026-11-24 21:11:56 -05:00
Joseph Magly bb49a5e1f2 fix(recipes): require injected runners to enter the launch guard
From the Muse BT6 audit of #625: launch_guard returns a wrapped context
manager that counts an entry only after the real guard has taken the lock
and checked the marker, and counts exits; after the step the run requires at
least one entry and matching exits, so calling the factory without entering
it fails closed (exit 4). The CLI no longer prints the first error line twice.
2026-11-24 20:55:56 -05:00
Joseph Magly ddc4762604 fix(viewer,report): name-sorted fallback metric, latest-load-wins reads, report-matching percent change
Codex review r4 for #618: when the study metric has no measured change, the
fallback is the first measured metric in name order (the order save_json
writes), so a live run, replay and the viewer agree; the order-preserving
reader is no longer needed and is removed. Every upload, drop or demo load
starts a new generation and stale reads are ignored. Viewer percentages use
the absolute baseline and show unavailable for a zero baseline, as the
report does.
2026-11-24 20:22:21 -05:00
Joseph Magly 42137dc159 fix(recipes): keep exit 4 through log and stop failures; guard every launch path
Codex review r4 for #625: the step exit code is captured before the log
closes and an observed exit 4 stays a cleanup failure even when stopping the
step group fails afterwards; every launch path (POSIX, non-POSIX and injected
runners) holds the cleanup guard through process creation and waits outside
it, and a runner that skips the guard fails closed; the recipe CLI prints the
cleanup error's notes and any interrupting signal on exit 4.
2026-11-24 20:20:27 -05:00
Joseph Magly dc1f92747a Merge main 20a09c6 into fix/600-602-vocab-discovery-roundtrip-concurrency 2026-11-24 20:04:34 -05:00
Joseph Magly 82eeeaceb2 fix(persistence): never roll back or delete published no-replace outputs; keep default checkpoint semantics
Codex review r3 for #621: once the opt-in no-replace checkpoint commit has
published, it is never rolled back (a later sync failure is reported and the
complete checkpoint left in place), and discovery never moves or deletes a
published file (a later failure names what was published); only private temp
files are removed. The staging path is never cleaned after a no-replace
publish. The default replace_existing=True path keeps main's semantics
unchanged (its rollback race is tracked in #645).
2026-11-24 20:04:32 -05:00
Joseph Magly a4af133c90 fix(viewer,report): linear-time trim, real-pair deltas, and an error state for failed loads
Codex review r3 for #618: the viewer trims ASCII whitespace by scanning
instead of a backtracking regex; report availability, plotted deltas, the
heatmap and the summary compute changes from each metric's own value and
baseline so generated column names cannot collide with raw metric names;
failed uploads clear the results and show an error; strict JSON (no NaN or
Infinity tokens) is documented as the shared input contract.
2026-11-24 19:48:43 -05:00