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
|
|
@ -526,14 +526,14 @@ static void test_pre_replay_pause_blocks_before_any_event_is_processed(void)
|
|||
char aux_dir[PATH_MAX];
|
||||
char script_path[PATH_MAX];
|
||||
char capture_path[PATH_MAX];
|
||||
char pend_marker[80];
|
||||
char round_marker[96];
|
||||
char jobid_buf[64];
|
||||
FILE* f;
|
||||
pid_t pid;
|
||||
int status;
|
||||
char* captured;
|
||||
char* ready_pos;
|
||||
char* pend_pos;
|
||||
char* round_pos;
|
||||
|
||||
f = write_header_and_snapshot(replay_path, sizeof(replay_path),
|
||||
"_prepause");
|
||||
|
|
@ -574,23 +574,34 @@ static void test_pre_replay_pause_blocks_before_any_event_is_processed(void)
|
|||
|
||||
captured = read_whole_file(capture_path);
|
||||
|
||||
/* bug-1591: sim_print_decision() (sim_loop.c) now renders jobids via
|
||||
* fmt_jobid(), not raw %llu -- this marker must match that same
|
||||
* human-readable form. */
|
||||
/* scheduler-sim-repl-verbosity task 4.2 (Req 2.3, bug-1610): under
|
||||
* `continue` mode sim_print_decision()'s bare per-decision line no
|
||||
* longer prints -- the Round Rollup (repl_rollup.c) reports the
|
||||
* session's decision instead, deferred until the collapsed range
|
||||
* ends. This fixture has exactly one round, so that range is only
|
||||
* flushed (and printed) by xce_repl_on_replay_complete()'s
|
||||
* repl_round_collapse_flush() call, triggered here by the script's
|
||||
* trailing `quit`. Look for that round-rollup summary's
|
||||
* "jobids=<...>" field instead of the old bare "PEND jobid=<...>"
|
||||
* line as evidence the fixture's one session produced a live
|
||||
* decision -- bug-1591's fmt_jobid()-vs-raw-%llu fix applies equally
|
||||
* to repl_fmt_jobid_range()'s single-jobid rendering (repl.c), which
|
||||
* is byte-identical to fmt_jobid()'s own non-array format. */
|
||||
fmt_jobid(jobid_buf, sizeof(jobid_buf), 4242ULL);
|
||||
snprintf(pend_marker, sizeof(pend_marker), "PEND jobid=%s", jobid_buf);
|
||||
snprintf(round_marker, sizeof(round_marker), "jobids=%s", jobid_buf);
|
||||
|
||||
ready_pos = strstr(captured, "[sim] ready. type 'help' for commands.");
|
||||
pend_pos = strstr(captured, pend_marker);
|
||||
round_pos = strstr(captured, round_marker);
|
||||
|
||||
TEST_ASSERT_NOT_NULL_MESSAGE(ready_pos,
|
||||
"pre-replay pause banner must be printed");
|
||||
TEST_ASSERT_NOT_NULL_MESSAGE(pend_pos,
|
||||
TEST_ASSERT_NOT_NULL_MESSAGE(round_pos,
|
||||
"the fixture's one session must have "
|
||||
"produced a live PEND decision");
|
||||
TEST_ASSERT_TRUE_MESSAGE(ready_pos < pend_pos,
|
||||
"produced a live PEND decision, reported "
|
||||
"via the round rollup summary");
|
||||
TEST_ASSERT_TRUE_MESSAGE(ready_pos < round_pos,
|
||||
"the pre-replay pause banner must appear "
|
||||
"BEFORE any decision output -- proves no "
|
||||
"BEFORE any round-rollup output -- proves no "
|
||||
"event was processed before the pause");
|
||||
|
||||
free(captured);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue