myxce/src/controller
Rongsong Shen 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
..
include feat(config-upgrade-snapshot): restore host admin-state frame safely (create-if-missing) 2026-07-24 12:48:28 +00:00
testsuite feat(scheduler-core): implement REPL execution control (task 12.1) 2026-08-07 08:17:35 +00:00
apiserver.c fix(schema): rename struct Data -> XceData to unshadow capnp builtin blob type 2026-07-22 09:22:04 +00:00
CLAUDE.md docs(raft-adapter-conformance): extend controller conformance record with this feature's findings 2026-07-30 03:39:56 +00:00
cluster.c test(scheduler-core): controller-side admin opcode dispatch tests (task 10.2) 2026-08-06 04:19:58 +00:00
commit.c feat(raft-apply-decoupling): ordered live apply pump activates apply_committed_entry (task 6.1) 2026-07-04 19:00:43 +00:00
config_repl.c feat(raft-adapter-conformance): send explicit reply on every config-push outcome 2026-07-29 09:43:35 +00:00
config_repl.h feat(raft-adapter-conformance): send explicit reply on every config-push outcome 2026-07-29 09:43:35 +00:00
ctrl_metrics.c feat: P3-7 ctrl_metrics — 7 atomic counters/gauges + descriptor table + persist wiring 2026-05-08 00:04:06 +00:00
ctrlstatus.c feat(ha-heartbeat-committed-propagation): migrate last_known_committed_config_tag to _Atomic (task 1.1) 2026-06-20 11:27:46 +00:00
dataex.c fix(persist): zero nresvals_to_sched after free_name_val_list 2026-05-20 09:39:07 +00:00
egress.c feat(ha-convergence-recovery): commit-gated scheduler egress — submit_lsn tagging + watermark gate (task 1.2) 2026-06-14 02:33:36 +00:00
ha.c fix(ha): free liveness poll ctx on failed/skipped delaymgr schedule (bug-1483) 2026-08-02 04:36:37 +00:00
ha.h docs(raft-adapter-conformance): document dormant AppendEntries sender + non-regression guard 2026-07-29 15:04:07 +00:00
ha_convergence.c fix(controller): bug-1450/1451 offload delaymgr-inline blocking work to the slow lane 2026-07-19 08:14:00 +00:00
job.c merge 2026-07-23 12:35:10 +08:00
join.c fix(controller): bug-1433 async-thread fdatasync block + bug-1434 committed_lsn CAS race 2026-07-11 12:16:28 +00:00
main.c fix(config): serialize load_primary_config against concurrent invocations (bug-1476) 2026-07-28 08:13:54 +00:00
meson.build feat(scheduler-core): implement REPL execution control (task 12.1) 2026-08-07 08:17:35 +00:00
misc.c save works 2026-03-05 16:03:37 +08:00
myapp.c fix(ha): retry cluster_init_phase2 on failure instead of latching phase2_done unconditionally (bug-1477) 2026-07-28 13:25:48 +00:00
myconf.c fix(config): serialize load_primary_config against concurrent invocations (bug-1476) 2026-07-28 08:13:54 +00:00
opget.c fix(schema): rename struct Data -> XceData to unshadow capnp builtin blob type 2026-07-22 09:22:04 +00:00
opupd.c save works 2026-03-03 16:49:26 +08:00
persist.c fix(ha): close permanent standby catch-up wedge after a WAL_CHECKPOINT boundary (bug-1475) 2026-07-28 04:48:53 +00:00
queue.c feat(ha-commit-barrier-rollout): commit-first-then-reply in all four handlers (task 3.2) 2026-06-12 10:28:25 +00:00
repl.c fix(ha): close permanent quorum-loss deadlock on log-conflicted standby (bug-1479) 2026-07-29 04:11:32 +00:00
reply.c fix(persist): zero nresvals_to_sched after free_name_val_list 2026-05-20 09:39:07 +00:00
resources.c update controller code 2025-11-05 16:58:57 +08:00
sched.c feat(controller): wire real limits.yaml config through cluster_config 2026-07-23 04:24:01 +00:00
slowlane.c feat(raft-drive-async): SlowLane bounded executor for long blocking I/O (task 1.2) 2026-06-26 05:24:00 +00:00
startup_validation.c feat(ha-heartbeat-liveness): add validate_heartbeat_config startup check (task 1.2) 2026-06-01 12:26:29 +00:00
task.c save works 2026-03-04 18:18:53 +08:00
worker.c fix(worker): replicate admin host-control status updates to standbys (bug-1472) 2026-07-26 04:06:42 +00:00