myxce/.wolf
Rongsong Shen 1a32e63a86
feat(scheduler-core): implement snapshot save and load (task 8.1)
Adds xce_sched_core_save_snapshot()/xce_sched_core_load_snapshot(),
split across snapshot.c/snapshot_wire.c/snapshot_load.c (800-line cap)
along real save/load/shared-helper boundaries. Serializes the full
core state (config, jobs, queues, workers, resources, resvals, users,
projects, prng_seed, internal_state) into/out of sched_snapshot_data_t
(task 7.3's committed C mirror of the capnp SnapshotData struct) as
plain in-memory structures -- no wire encoding here, that's a later
task. After load, rebuilds the picker's private state by re-invoking
its state-change hooks (queue updates, then job pushes) against the
restored core state, matching xce_core_push_events()'s own hook-firing
order; picker-private state itself is never stored in the snapshot.

Adds a new prng_seed field to xce_sched_core_t -- requirements.md/
design.md both presuppose it but no prior task added it. Seeded to 0,
no PRNG consumer wired yet (deliberately out of scope).

Cross-core behavioral-equivalence proven directly: two independent
cores, each with its own registered picker, save on one and load into
a freshly-initialized other, both driven through an identical real
session, decision sequences asserted identical in order.

Found and fixed two real bugs along the way: a missing prng_seed
restore in this task's own new code, and a genuine guard bug in
already-committed core.c (sched_get_user()/sched_get_project()
treating key_find()'s expected -ENOENT as fatal, silently breaking
get-or-create for any new name) that also affects the live production
path (make_sched_job(), JOBS_PUSH) -- a narrowly-scoped two-line fix,
independently traced to the primitive level and confirmed correct by
review.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019dw5WnN3DXStaEaPYfACU1
2026-08-05 03:57:10 +00:00
..
hooks chore(wolf): update buglog and session state 2026-08-02 04:37:36 +00:00
anatomy.md chore(wolf): update buglog and session state 2026-08-02 04:37:36 +00:00
buglog.json feat(scheduler-core): implement snapshot save and load (task 8.1) 2026-08-05 03:57:10 +00:00
cerebrum.md fix(xce-test-ha): retry chaotic-mode verify_classify before counting job loss (bug-1487) 2026-07-31 05:16:14 +00:00
config.json chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
cron-manifest.json chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
cron-state.json chore: sync OpenWolf state (buglog, cerebrum, memory, anatomy) 2026-07-03 02:41:41 +00:00
daemon.log chore: sync OpenWolf state (buglog, cerebrum, memory, anatomy) 2026-07-03 02:41:41 +00:00
designqc-report.json chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
identity.md chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
memory.md chore(wolf): update buglog and session state 2026-08-02 04:37:36 +00:00
OPENWOLF.md chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
reframe-frameworks.md chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
suggestions.json chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
token-ledger.json chore(wolf): update buglog and session state 2026-08-02 04:37:36 +00:00