Commit graph

189 commits

Author SHA1 Message Date
82d37b2d61
chore(wolf): checkpoint buglog.json (960 bugs) 2026-08-18 09:10:52 +00:00
23c3fd6b6a
chore(wolf): checkpoint buglog.json (959 bugs) 2026-08-18 07:54:29 +00:00
efc9f1386a
chore(wolf): checkpoint buglog.json (959 bugs) 2026-08-18 07:00:13 +00:00
db6ed39d37
chore(wolf): checkpoint buglog.json (959 bugs) 2026-08-18 06:43:09 +00:00
833f200268
chore(wolf): checkpoint buglog.json (959 bugs) 2026-08-18 04:49:00 +00:00
4fa7d8fc7e
chore(wolf): checkpoint buglog.json (958 bugs) 2026-08-18 04:14:56 +00:00
2ca25eebd0
chore(wolf): checkpoint buglog.json (957 bugs) 2026-08-18 03:33:03 +00:00
04ecfa5cc1
chore(wolf): checkpoint buglog.json (955 bugs) 2026-08-18 02:42:28 +00:00
bc1380017e
chore(wolf): checkpoint buglog.json (954 bugs) 2026-08-18 01:37:10 +00:00
fd5ab8b20d
chore(wolf): checkpoint buglog.json (952 bugs) 2026-08-18 00:46:50 +00:00
a336884fc4
chore(wolf): checkpoint buglog.json (951 bugs) 2026-08-17 23:45:24 +00:00
2954f697a3
chore(wolf): checkpoint buglog.json (950 bugs) 2026-08-17 23:27:25 +00:00
54ea3bc5b5
chore(wolf): checkpoint buglog.json (950 bugs) 2026-08-17 22:56:55 +00:00
673759f83b
chore(wolf): checkpoint buglog.json (950 bugs) 2026-08-17 12:38:43 +00:00
c672e3c2bf
chore(wolf): checkpoint buglog.json (950 bugs) 2026-08-17 12:02:57 +00:00
0d1ab09eb7
chore(wolf): checkpoint buglog.json (949 bugs) 2026-08-17 10:35:47 +00:00
c3980cbfb3
chore(wolf): checkpoint buglog.json (946 bugs) 2026-08-17 10:03:59 +00:00
265792514f
chore(wolf): checkpoint buglog.json (946 bugs) 2026-08-17 09:46:27 +00:00
ac8404b245
chore(wolf): checkpoint buglog.json (944 bugs) 2026-08-17 08:58:02 +00:00
a79de88ab2
chore(wolf): checkpoint buglog.json (942 bugs) 2026-08-17 08:31:30 +00:00
d877a64805
chore(wolf): checkpoint buglog.json (941 bugs) 2026-08-17 08:28:10 +00:00
52461f6630
chore(wolf): checkpoint buglog.json (940 bugs) 2026-08-17 08:21:06 +00:00
5347679991
chore(wolf): checkpoint buglog.json (937 bugs) 2026-08-17 08:04:41 +00:00
402fa67288
chore(wolf): checkpoint buglog.json (935 bugs) 2026-08-17 07:23:08 +00:00
b8d50d00d4
chore(wolf): checkpoint buglog.json (931 bugs) 2026-08-17 07:01:06 +00:00
2f0d74696b
chore(wolf): checkpoint buglog.json (929 bugs) 2026-08-17 06:54:45 +00:00
c235320842
chore(wolf): checkpoint buglog.json (927 bugs) 2026-08-17 06:46:31 +00:00
f8a4b1e668
chore(wolf): checkpoint buglog.json (925 bugs) 2026-08-17 05:37:22 +00:00
ca6da7eb6d
chore(wolf): checkpoint buglog.json (925 bugs) 2026-08-17 05:04:02 +00:00
157a0d9ce9
chore(wolf): checkpoint buglog.json (922 bugs) 2026-08-17 03:50:19 +00:00
a75a469569
chore(wolf): checkpoint buglog.json (922 bugs) 2026-08-17 03:48:12 +00:00
126a9e4aba
chore(wolf): checkpoint buglog.json (921 bugs) 2026-08-17 03:39:56 +00:00
397d8e7f9c
chore(wolf): checkpoint buglog.json (920 bugs) 2026-08-16 12:13:23 +00:00
1faa974e71
chore(wolf): checkpoint buglog.json (918 bugs) 2026-08-16 11:13:45 +00:00
3f58a3636b
chore(wolf): checkpoint buglog.json (917 bugs) 2026-08-16 10:48:36 +00:00
b33f8b68a6
chore(wolf): checkpoint buglog.json (917 bugs) 2026-08-16 10:20:13 +00:00
0cb5918517
chore(wolf): checkpoint buglog.json (897 bugs) 2026-08-13 13:19:20 +00:00
922d57bb4f
chore(wolf): checkpoint buglog.json (895 bugs) 2026-08-13 12:01:04 +00:00
369ee9fefc
chore(wolf): checkpoint buglog.json (894 bugs) 2026-08-13 10:53:35 +00:00
558c92d66d
chore(wolf): checkpoint buglog.json (893 bugs) 2026-08-13 10:48:23 +00:00
726bcc52f5
chore(wolf): checkpoint buglog.json (893 bugs) 2026-08-13 10:46:23 +00:00
53dfd078c9
chore(wolf): checkpoint buglog.json (892 bugs) 2026-08-13 09:31:50 +00:00
ab6639df56
chore(wolf): checkpoint buglog.json (885 bugs) 2026-08-13 08:27:28 +00:00
9e15161228
chore(wolf): checkpoint buglog.json (880 bugs) 2026-08-13 08:10:28 +00:00
ff87986950
chore(wolf): checkpoint buglog.json (871 bugs) 2026-08-13 04:28:57 +00:00
ce96fd6d93 save wolf status 2026-08-10 18:01:29 +08:00
1fd467d072
fix(controller): stop SIGSEGV in WalCatchupEntry capnp encode (bug-1505)
controller_unit_test crashed deterministically in write_WalCatchupEntry
(test_wal_catchup_append_term_fields_round_trip) -- the same bug class
as bug-1504 (SnapshotData.internalState): this codebase's capnpc-c
backend silently no-ops Data-field encoding in generated encode_XXX()
composite helpers without zero-initializing the caller's local struct
first, leaving an uninitialized capn_ptr written onto the wire.

Confirmed zero production exposure before fixing: xce_wal_batch_encode_
raw()/wal_entry_to_wire() (request.c) never call the generic
encode_WalCatchupEntry() at all -- they memset() their own struct and
call write_WalCatchupEntry() directly with every field hand-set, so
this was 100% test-only exposure (grepped every caller of the generic
encode/decode pair; only the crashing test uses it).

Fix mirrors bug-1504: WalCatchupEntry.payload (@2) and batchPayloads
(@10) switched from Data to List(UInt8) in controller.capnp (new
batchPayloadsLen @11 companion; payload reuses the existing
wirePayloadLen @9), typemap.h's wal_catchup_entry_t field types
updated, and request.c's extract_data_bytes() widened to take a raw
capn_ptr (it already only used .p internally) so its call sites work
regardless of which Data-shaped wrapper the generated accessor
returns now. batchPayloads' single-top-level-blob shape confirmed
this does not reintroduce bug-847's per-element cross-segment
far-pointer loss -- that issue is inherent to per-element data
regardless of Data vs List(UInt8) spelling.

Strengthened test_wal_catchup_append_term_fields_round_trip with real
payload/batchPayloads content assertions -- previously never
exercised, since the test's src fields were left NULL.

Verified: controller suite 3/3 (was 2/3, crashing), scheduler suite
unaffected at 37/37 (unrelated schema area).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JPPXeKSUXUqcqvzNXY1rzJ
2026-08-07 11:09:27 +00:00
2fecea3592
feat(scheduler-core): implement REPL breakpoints and state inspection (task 12.2)
Adds the interactive simulation REPL's breakpoint and state-inspection
commands (Req 5 AC 22): `break <event_type> [key=value ...]` / `info
break` / `delete <id>|all` on event and decision types, and `info
session/job/queue/worker/resource/summary`.

repl.c (370 lines after task 12.1) couldn't hold this task's full
surface under the project's 800-line cap, so it's split three ways
(matching the snapshot.c/snapshot_wire.c/snapshot_load.c precedent):
repl.c (execution control + dispatch), repl_break.c (matching/CRUD +
the three new driver-facing hooks), repl_info.c (info dumps), sharing
state via repl_internal.h. sim_loop.c gained 3 new bare hook calls
(repl.h inline wrappers, same pattern as task 12.1's two) at the
points design.md's pseudocode requires -- per decoded event before it
joins the batch, per session boundary, and per drained decision --
landing sim_loop.c at exactly 800/800 lines.

Two real bugs found and fixed during development (bug-1506, bug-1507):
an uninitialized xstr_table left breakpoint filter fields silently
NULL instead of failing loud, and repl_breakpoint_free() called a bare
free() on an RTTI-refcounted makeString() string, corrupting the heap.

Review found one gap: `info job` printed only a resreq presence flag
instead of the actual resreq text, when format_resreq() already
existed in this repo for exactly this purpose. Fixed to match.

Scheduler suite: 35/35 clean (was 34/34). RED-phase evidence (2 real
bugs plus 2 synthetic probes, all reverted with confirmed zero
residue) recorded in tasks.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JPPXeKSUXUqcqvzNXY1rzJ
2026-08-07 09:46:16 +00:00
02f7f48ff9
feat(scheduler-core): implement REPL execution control (task 12.1)
Adds the interactive simulation REPL's execution-control slice (Req 5
AC 22): a single-threaded input loop (readline-based) supporting
step [N], continue, quit, and help, pausing before the first replay
event and blocking the driver loop while active.

Review round 1 raised two findings, both resolved here:

- GNU readline (GPL) was linked directly into xce_scheduler, a shipped
  production daemon. Switched the whole project to libedit (BSD) for
  line editing -- scheduler and controller (xce_test) both now use
  editline/readline.h, API-compatible (readline()/add_history()).

- Getting a clean regression run after the libedit swap required a
  full clean rebuild, which exposed a genuine pre-existing SIGSEGV
  (bug-1504): SnapshotData.internalState was a capnp Data field, and
  this codebase's capnpc-c backend silently no-ops Data-field
  encoding without zero-initializing the caller's stack struct,
  leaving an uninitialized capn_ptr written onto the wire. Fixed by
  switching internalState to List(UInt8) (with a new internalStateLen
  wire field), matching the working FetchFileReply.content/bytesRead
  precedent -- no hand-written accessor code needed.

A second, unrelated instance of the same bug class was found in the
controller's WAL-catchup path (WalCatchupEntry.payload) and
deliberately left unfixed as bug-1505, out of scheduler-core's
boundary; needs its own project-wide Data-field audit.

Scheduler suite: 34/34 clean. RED-phase reproduction recorded in
tasks.md (repl_should_pause() step-budget check disabled -> 2/4
tests fail as expected -> reverted -> 34/34 green).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JPPXeKSUXUqcqvzNXY1rzJ
2026-08-07 08:17:35 +00:00
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