feat(scheduler-sim-repl-verbosity): task 4.2 - retire redundant per-decision echo
Gates sim_print_decision() so the bare per-decision line no longer prints under continue mode, making the Round Rollup's summary the sole source of decision output (Requirement 2.3, closing bug-1610). step mode and non-interactive/headless runs are completely unaffected (Requirements 5.1, 5.4). Implemented as a file-local inline wrapper in sim_loop.c rather than repl.h, since the gated function is static to that file and repl.h can't see repl_state's internals without leaking them to every other repl.h consumer. Fixes 3 pre-existing tests (predating this spec, from scheduler-core) that pinned the now-intentionally-changed bare-line behavior under continue mode - each fixed differently based on its actual purpose rather than uniformly: two kept continue mode with their anchor switched to the Round Rollup's summary (since they specifically test continue-mode breakpoint interruption, which step mode would trivialize), one switched to step mode (since its actual invariant - print-before-breakpoint-check call order - is mode-independent and continue mode no longer has any observable anchor for it). Review caught a second, unguarded sim_print_decision() call site in sim_reconcile_unaccounted_jobs() (added by an earlier, separately- merged spec) that design.md's boundary never accounted for - per the review, this is actually the dominant real-world path for DISPATCH decisions in replay mode, so leaving it unguarded would have defeated Requirement 2.3's "sole source of decision output" claim for the common case. Gated it through the same wrapper; added 2 new tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YAWMhfRJFnmmnG8h97yUDd
This commit is contained in:
parent
3d08a43a35
commit
d9109b7c4b
7 changed files with 386 additions and 39 deletions
|
|
@ -110,7 +110,7 @@ flowchart TD
|
|||
- `src/scheduler/src/repl_rollup.c` (new, post-review — Correction above) — the Round Rollup's own fingerprint-build/pend-jobid-query/emit/flush/round-boundary-process logic (Requirements 2, 3), split out of `repl.c` to stay under the 800-line cap; shares state with `repl.c` via `repl_internal.h`, matching `repl_break.c`/`repl_info.c`/`repl_params.c`'s established split; added to `scheduler_srcs` in `src/scheduler/meson.build` immediately after `repl.c`.
|
||||
- `src/scheduler/src/repl_info.c` — new resource-value classification/scaling helpers (byte-denominated list, `swp`'s megabyte special case, whole-number formatting) and a table/grouping rewrite of `repl_info_worker()`'s and `repl_info_resource()`'s resource-listing loops, both reading `rs->units_mode` (Requirement 6); the assigned-job listing in `repl_info_worker()` adopts the jobid-range-compression helper (Requirement 4.5).
|
||||
- `src/scheduler/src/repl_params.c` — `repl_cmd_set()` gains a `units raw|human|both` branch alongside the existing `speed`/`output`/`verify` branches, storing the selection on the new `rs->units_mode` field (Requirement 6.2, 6.3).
|
||||
- `src/scheduler/src/sim_loop.c` — the existing call site invoking `sim_print_decision()` gains a `continue`-mode gate, mirroring `repl.h`'s inline-wrapper convention (Requirements 2, 5).
|
||||
- `src/scheduler/src/sim_loop.c` — the existing call site invoking `sim_print_decision()` gains a `continue`-mode gate, mirroring `repl.h`'s inline-wrapper convention (Requirements 2, 5). **Correction (post-review, task 4.2 remediation)**: this bullet's original "the existing call site" (singular) undercounted the file's actual production call sites — `sim_loop.c` has TWO direct calls to `sim_print_decision()`, `sched_sim_driver_run()`'s main decision-drain loop (this bullet's original target) AND `sim_reconcile_unaccounted_jobs()`'s reconstructed-decision report (added by the sibling scheduler-sim-decision-parity/scheduler-sim-eager-reconciliation specs, unrelated in authorship but real production code that reports DISPATCH decisions through this exact channel). Since that reconciliation path is a primary source of DISPATCH decisions surfacing in replay mode, leaving it unguarded reproduced bug-1610's own duplication there too. Both call sites now route through `sim_print_decision_gate()` — see the `sim_print_decision` Gate component's own Correction below for the updated Boundary Commitment.
|
||||
- `src/scheduler/include/repl.h` — no functional change expected; existing inline wrappers already cover the gating points this feature needs.
|
||||
|
||||
### New/Modified Test Files
|
||||
|
|
@ -263,7 +263,9 @@ int repl_fmt_jobid_range(char* buf, size_t bufsz,
|
|||
|
||||
**Responsibilities & Constraints**
|
||||
- Skip the direct print only when `sim->interactive && sim->repl_state->mode == XCE_REPL_MODE_CONTINUE`; `step` mode and non-interactive (headless) runs are unaffected (Requirement 5.1, 5.4).
|
||||
- Implemented as an inline-wrapper-style gate at the existing call site in `sched_sim_driver_run()`, consistent with `repl.h`'s established convention, rather than a bare `if` block added to the loop body.
|
||||
- Implemented as an inline-wrapper-style gate, consistent with `repl.h`'s established convention, rather than a bare `if` block added to each call site's body.
|
||||
|
||||
**Correction (post-review, task 4.2 remediation)**: this component's original Boundary Commitment named "the existing call site in `sched_sim_driver_run()`" (singular). Review found `sim_loop.c` has a SECOND, direct, unguarded call to `sim_print_decision()` inside `sim_reconcile_unaccounted_jobs()` (added by the sibling scheduler-sim-decision-parity/scheduler-sim-eager-reconciliation specs after this design.md was originally written) — and that reconciliation path is actually a PRIMARY mechanism by which DISPATCH decisions surface in replay mode at all (most live-drain-loop activity is PEND). A round where reconciliation fires was therefore still showing both the bare per-decision line AND the Round Rollup's summary counting the same dispatch, reproducing bug-1610's own duplication via this second, previously-unaccounted-for call site. This component's gate (same function, same condition, no new symbol) now guards BOTH call sites: `sched_sim_driver_run()`'s main decision-drain loop (this component's original target) and `sim_reconcile_unaccounted_jobs()`'s reconstructed-decision report. Requirement 2.3/this feature's own Observable ("the round summary is the sole source of decision output") is only actually satisfied once both are covered — see `test_sim_reconcile_unaccounted.c`'s two new tests (`test_reconcile_continue_mode_with_repl_state_suppresses_bare_decision_line` / `test_reconcile_step_mode_with_repl_state_still_prints_bare_decision_line`) for the second call site's own contract coverage, parallel to `test_sim_print_decision_gate.c`'s existing coverage of the first.
|
||||
|
||||
**Contracts**: Service [ ] / API [ ] / Event [ ] / Batch [ ] / State [x]
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
- _Boundary: sim_print_decision gate_
|
||||
- _Depends: 2.2_
|
||||
|
||||
- [ ] 4.2 (P) Suppress the old per-decision echo during continuous execution so the round summary is the sole source of decision output
|
||||
- [x] 4.2 (P) Suppress the old per-decision echo during continuous execution so the round summary is the sole source of decision output
|
||||
- Leave single-stepping and non-interactive output untouched
|
||||
- Observable: all tests from 4.1 pass; a full continuous-execution run over a replay shows only round-summary lines, with no duplicate bare decision lines
|
||||
- _Requirements: 2.3, 5.1, 5.4_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue