Found by /kiro-validate-impl's cross-task requirements-coverage and design-alignment checks, both documentation-only (no code changes): 1. AC 6.5 (whole-number/no-trailing-.00 formatting) is implemented as scoped to non-consumable (Load Metrics) values only - a consumable resource's value=/used= pair deliberately keeps its unconditional %.2f formatting to preserve bug-1601/1613/1727's already-pinned display shape. This carve-out existed only as an inline code comment (repl_info.c) and a test-file header comment, never sanctioned in requirements.md/design.md itself. Amended AC 6.5's text to state the scope explicitly and added a design.md Correction note cross-referencing it. 2. design.md's File Structure Plan never documented task 6.1's proactive split of the prompt-content tests into a new test_repl_prompt_context.c (every other analogous split in this spec got a Correction note; this one didn't), and task 9.1's later Correction note repeated the stale claim that test_repl_execution_control.c "already carries" the prompt-content tests - it doesn't, they moved to the new file at task 6.1. Added the missing task 6.1 Correction note and fixed both stale references. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YAWMhfRJFnmmnG8h97yUDd
12 KiB
Requirements Document
Introduction
xce_scheduler's --interactive simulation REPL (shipped by the scheduler-core spec) lets an operator step or continue through a recorded replay while inspecting scheduler state. Under continue, the REPL currently prints the same volume of output as single-stepping every round — a real 108-round replay produced roughly 2,700 lines, most of it either routine per-event chatter that carries no new information under continue, or an unchanged pending-job decision repeated identically round after round. This feature reorganizes REPL output during continue execution so an operator can track a long replay's progress without wading through repetitive, low-information lines. It also extends a small number of specific, explicitly-scoped improvements to other parts of the REPL surfaced during this effort — the command prompt, info's job-identifier and resource-value listings, and help/break's discoverability — while leaving step mode's per-event and per-decision detail, and every other aspect of the REPL's existing commands, unchanged.
Boundary Context
- In scope: console output shown by the
--interactivesimulation REPL duringcontinueexecution — which events are echoed, how scheduling-decision outcomes are summarized per round, how repetitive rounds are collapsed, and how multi-job identifier lists are displayed; the REPL prompt's display of current session/timestamp context, applicable in bothstepandcontinuemodes; job-identifier range compression (Requirement 4) applied to theinfocommand's job-listing output (for exampleinfo worker's assigned-job list); human-readable resource value formatting, table layout, and the newset unitsdisplay-mode option (Requirement 6) applied to theinfocommand's resource listings; and the organization/completeness ofhelp's command listing andbreak's event-type discoverability (Requirement 7). - Out of scope: any new REPL command or newly inspectable data (for example limit usage or pend-reason detail — tracked separately under
scheduler-sim-diagnostics); any change to scheduling/allocation behavior or to the deterministic outcome of a replay; any change tostepmode's existing output, other than the prompt string itself; non-interactive (headless, no-i) scheduler output. - Adjacent expectations: this feature extends the existing REPL shipped by
scheduler-core(implementation-complete) without changing its command surface.scheduler-sim-diagnostics(currently a discovery brief, not yet a formal spec) is expected to separately add pend-reason and limit-usage inspection; this feature's round summaries should remain compatible with, and not duplicate, that future work.
Requirements
Requirement 1: Mode-Aware Event Echo During Continuous Execution
Objective: As an operator running a simulation replay, I want continue to suppress routine per-event chatter while still alerting me to major state changes, so that I can watch a long replay without being flooded by lines carrying no new information.
Acceptance Criteria
- While the REPL is executing in continue mode, when a routine per-event notification (a job status change, a job progress update, a job resource-usage update, a queue update, or a partial/delta resource-value update) occurs, the REPL shall not print an individual line for that event.
- While the REPL is executing in step mode, when any event occurs, the REPL shall print an individual line for that event.
- When a structural change occurs (new jobs submitted, new workers added, new resources added, a full resource-value snapshot arriving, or configuration pushed), the REPL shall print a line describing that change regardless of execution mode.
- When an event matches a defined breakpoint, the REPL shall interrupt continue-mode execution and enter the interactive command loop, regardless of whether the event is routine or structural.
Requirement 2: Per-Round Decision Summary
Objective: As an operator watching simulation replay progress, I want one summary line per round showing what scheduling decisions were made, so that I can track scheduling outcomes without reading a separate line per affected job.
Acceptance Criteria
- While the REPL is executing in continue mode, when a round completes with at least one scheduling decision (dispatch, pend, or preempt), the REPL shall print one summary line for that round showing the count of each decision type and the identifiers of the jobs affected.
- When a round completes with zero scheduling decisions, the REPL shall not print an individual decision line for that round.
- While the REPL is executing in step mode, the REPL shall print full per-decision detail for every decision.
- When a job's tracked status changes from one round to the next, the REPL's round summary shall reflect that change.
Requirement 3: Collapsing of Repetitive Round Output
Objective: As an operator, I want consecutive rounds that produce no new information to be reported as a single range instead of one line each, so that long stretches of idle or unchanged simulation state don't dominate the output.
Acceptance Criteria
- When two or more consecutive rounds occur with zero scheduling decisions, the REPL shall report them as a single collapsed range instead of one line per round.
- When two or more consecutive rounds occur with an identical decision outcome (same decision counts and the same affected job identifiers), the REPL shall report them as a single collapsed range instead of repeating the same summary line for each round.
- The REPL shall include the first round number, the last round number, and the round count in every collapsed range notification.
- Where round timestamps are displayed, the REPL shall include the covered time span in each collapsed range notification.
- When a round's decision outcome differs from the immediately preceding reported round, or a structural event occurs, the REPL shall end the active collapsed range and report it before continuing.
- When continue-mode execution stops for any reason (a breakpoint hit or replay completion), the REPL shall end and report any active collapsed range before the stop is reported to the operator.
Requirement 4: Job Identifier Range Compression
Objective: As an operator reading REPL output that lists many job identifiers from the same job array submission, I want those identifiers compressed into an index range, so that I can read the list without scrolling past dozens of nearly-identical entries.
Acceptance Criteria
- When the REPL displays two or more job identifiers that belong to the same job array submission and have contiguous array indices, the REPL shall display them as a single compressed index range.
- When job identifiers from the same job array submission have non-contiguous indices, the REPL shall display each contiguous sub-range separately within the same listing.
- When a listing contains job identifiers from more than one job array submission, the REPL shall group and compress each job array submission's identifiers independently.
- When a listing mixes job-array and non-array job identifiers, the REPL shall display the non-array job identifiers individually while compressing the job-array identifiers as described above.
- The REPL shall apply job identifier range compression consistently everywhere it displays multiple job identifiers together, including job-arrival notifications, round decision summaries, and the
infocommand's job-identifier listings (for exampleinfo worker's assigned-job list).
Requirement 5: Preservation of Existing REPL Behavior Outside This Feature's Explicit Changes
Objective: As an operator relying on today's step behavior and info/break/delete/set/snapshot/help commands, I want everything this feature does not explicitly call out as changing (Requirements 4, 6, and 7, plus this requirement's own AC 5) to keep working exactly as before, so that existing debugging workflows aren't disrupted by scope creep.
Acceptance Criteria
- The REPL shall preserve existing
stepcommand output exactly as before this feature, with no reduction in per-event or per-decision detail. - The REPL shall preserve existing
info,break,delete,set,snapshot, andhelpcommand behavior and output format unchanged, except where Requirement 4, 6, or 7 explicitly specifies a change. (This AC is intentionally a cross-reference, not a restated list, so a future requirement's own scoping ACs remain the single source of truth for what it changes.) - The REPL shall introduce no new top-level command as part of this feature;
set unitsis a new option of the existingsetcommand, following the sameset <key> <value>form as today'sset speed/set output/set verify. - The REPL shall not alter the scheduling decisions or final simulation state produced by a replay — only the console output describing them.
- When the REPL displays its command prompt, the REPL shall include the current session identifier and timestamp, without altering any other step-mode or continue-mode output.
Requirement 6: Human-Readable Resource Value Formatting
Objective: As an operator reading info worker/info resource output, I want byte-denominated resource values shown in a readable unit and the listing laid out as a scannable table, with control over how much raw-vs-human detail I see, so I don't have to mentally parse 13-digit raw byte counts or hunt for one resource among 20 unstructured lines.
Acceptance Criteria
- When the REPL displays a resource whose canonical wire unit is bytes (
mem,tmp,maxmem,maxtmp,maxswap) or theswpresource (whose canonical wire unit is megabytes), the REPL shall render its value using the operator's selected units display mode. - The REPL shall support a
set units raw|human|bothoption:rawshows only the numeric wire value,humanshows only an adaptively-scaled unit (B/KB/MB/GB/TB/PB), andbothshows the raw value with the human-readable form alongside. - Absent an explicit
set unitscommand, the REPL's units display mode shall default toboth. - The REPL shall not alter the underlying stored/wire value of any resource, nor the deterministic outcome of a replay — only its console display.
- The REPL shall display numeric resources with no canonical unit (for example load averages, factors, and counts) without a unit suffix, and without a trailing
.00when the value is a whole number. This rule applies to non-consumable (Load Metrics) values; a consumable/capacity resource'svalue=/used=pair keeps its existing unconditional two-decimal display (bug-1601/1613/1727's pinned shape) and is out of scope for this AC. - The REPL shall display
info worker's andinfo resource's resource listings as an aligned table, grouping resources by category (consumable/capacity, load metrics, static hardware attributes) where applicable to that listing, rather than one flat list.
Requirement 7: Discoverable Help and Breakpoint Event Types
Objective: As an operator learning or re-learning the REPL's command surface, I want help's listing organized and complete, and every valid break event type discoverable without reading source, so I can find and use a command correctly on the first try instead of by trial-and-error.
Acceptance Criteria
- The REPL's
helpoutput shall group commands into labeled sections by concern (execution control, breakpoints, state inspection, snapshot and parameters) instead of one flat list. - Within each section, the REPL shall align every command's description to a single column position computed consistently, rather than independently hand-padded per line.
- The REPL's
helpoutput shall listinfo configtogether with the otherinfosubcommands in the state-inspection section. - The REPL's
helpoutput shall enumerate the complete set of valid<EVENT_TYPE>values accepted bybreak. - When
breakis given an event type that matches none of its valid values, the REPL's error message shall list the complete set of valid values. - The REPL shall not alter which commands exist, their argument parsing, or any other command's output — only the organization of
help's listing and the completeness ofbreak's event-type discoverability.