diff --git a/.kiro/specs/scheduler-sim-diagnostics/tasks.md b/.kiro/specs/scheduler-sim-diagnostics/tasks.md index 276cc3d4..a7b2b231 100644 --- a/.kiro/specs/scheduler-sim-diagnostics/tasks.md +++ b/.kiro/specs/scheduler-sim-diagnostics/tasks.md @@ -8,6 +8,15 @@ - _Requirements: 1.1, 1.2, 1.4, 2.1, 3.1_ - _Boundary: Limit Plugin Accessor_ +- [ ] 6. Bootstrap the limit plugin in sim mode so `info limit` shows real data against a replay (fixes `bug-1825`) + - Extract `limit_new_plugin()` factory out of `register_limit()` (`plugins/limit.c`), mirroring `builtin_fcfs_new_plugin()`/`register_builtin_fcfs()`'s existing factory-extraction pattern exactly; `register_limit()` itself must be behaviorally unchanged (pure refactor) + - New `sim_bootstrap_limit_plugin(xce_sched_sim_driver_t* sim)` (new file `sim_limit.c`, mirroring `sim_picker.c`'s structure/header-comment convention): `limit_new_plugin()` → `plugin_register_core(&(sim->core), plugin)` → if `sim->core.config != NULL`, call `plugin->hooks.config_hook(plugin, sim->core.config)` directly (NOT the type-unsafe `plugin_config_update()`, which casts its `void*` arg to `xce_scheduler_t*` and would misread `xce_sched_sim_driver_t`'s embedded `core` field) + - Wire the call into `sim_loop.c` right alongside the existing `sim_bootstrap_picker(sim)` call site — by that point `sim->core.config` already holds the snapshot's borrowed-reference config (set during `sched_sim_driver_start()`'s snapshot load, which runs first) + - Observable: a real `xce_sched_sim_driver_t` driven through `sched_sim_driver_start()` against a replay whose snapshot carries a real `xce_limit_config_t`, after the sim driver's own bootstrap sequence runs, has `limit_get_configured_limits()` return a handle that iterates to that real limit — no test-only registration helper needed + - _Requirements: 1.1–1.7 (makes them exercisable against a real replay, not just via a test-only fixture helper)_ + - _Boundary: Limit Plugin Accessor (factory extraction), new Sim Limit Bootstrap component_ + - **Known deliberate non-goal, tracked separately**: this task does NOT wire limit *matching* (`limit_job_election()`) into the sim/replay decision path — that function is only ever reached via `plugin_job_election()`, which is normal-mode-only (one caller, `scheduler.c`) and itself needs a core-safe variant before it could be called from `sim_loop.c`. Live usage (Requirements 2.x/3.x) will still show "no active usage instance yet" against a real replay even after this task — only the configured-setting display (1.1-1.7) becomes real. Tracked as a separate follow-up bug, not bundled into this task. + - [x] 2. Core: Limit lookup and configured-setting display - [x] 2.1 Implement name/all resolution with correct absence messaging - New white-box test file `test_repl_limit_table.c` created (sibling of `test_repl_resource_table.c`, own `#include` set covering `plugins/limit.c` and `resource.c` for real — not stubbed — per `design.md`'s build-wiring risk note citing bug-1762's precedent)