myxce/.kiro/specs/scheduler-sim-step-verbosity/tasks.md
Rongsong Shen 1374540954
docs(scheduler-sim-step-verbosity): add approved spec (requirements/design/tasks)
Follow-on to scheduler-sim-repl-verbosity: collapses the REPL's
per-event "[sim] t=... session=..." preamble to print once per
distinct rendered (timestamp, session) run of consecutive echoed
events, instead of once per event, in both step mode and continue
mode's structural-event echo. Requirement 1.3 deliberately keys the
dedup on the rendered, second-granularity timestamp rather than the
raw nanosecond clock value, which ticks on every event and would
otherwise never repeat -- confirmed against a real user-supplied
transcript before writing requirements (see research.md). Requirement
2 preserves event selection, ordering, content, every other REPL
command, and all scheduling decisions/state exactly as
scheduler-sim-repl-verbosity's Requirement 5 already established.

Generated via kiro-spec-quick (single-pass, no approval gates) with
an inline requirements review gate, an inline design review gate, and
an independent task-graph sanity review (one NEEDS_FIXES round,
repaired: added file-size watch bullets to tasks 1.1/1.2 per
design.md's own housekeeping directives).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAWMhfRJFnmmnG8h97yUDd
2026-09-03 03:53:24 +00:00

3.9 KiB

Implementation Plan

  • 1. Core: event echo preamble deduplication

  • 1.1 Write failing tests for preamble deduplication across consecutive echoed events

    • Cover: two consecutive echoed events with identical rendered timestamp and session omit the second's preamble; two consecutive events with a different session both print their own preamble; two consecutive events whose raw high-resolution timestamps differ but whose rendered timestamp and session are identical still dedupe; the first echoed event in a fresh REPL session always prints its preamble; a structural event echoed under continue mode after a stretch of suppressed routine events follows the same rule; every event's own content line and ordering remain present and unaffected regardless of the preamble decision
    • Observable: the new test cases fail against today's REPL, which prints the timestamp/session preamble unconditionally before every echoed event
    • After adding the new test cases, check test_repl_event_echo.c's resulting line count against this project's ~1000-line split trigger (design.md's File Structure Plan); if approached or exceeded, split the preamble-dedup tests into a new test_repl_step_verbosity.c (duplicating shared fixture helpers per this file family's established convention) and register the new file's test target in testsuite/meson.build
    • Requirements: 1.1, 1.2, 1.3, 1.4, 2.2
    • Boundary: Event Echo Preamble Deduplicator
  • 1.2 Implement the preamble deduplication cache and print-skip logic

    • Add the last-printed rendered timestamp and session cache to the REPL session state, zero-initialized alongside the state's existing fields; update the event echo path to compare the candidate rendered timestamp and session against the cache, printing and updating it only when either has changed (or no preamble has been printed yet this session), while always still printing the event's own content line unconditionally
    • Observable: all tests from 1.1 pass; a captured transcript shows exactly one preamble line per distinct rendered (timestamp, session) run of consecutive echoed events, with every event's own content line still present
    • After landing the implementation change, re-check repl_break.c's line count against its already-accepted 949-line residual (design.md's Architecture Integration); if it meaningfully exceeds that residual, evaluate extracting repl_print_event_summary() and its Event Echo Gate neighbors into a new file rather than pre-splitting speculatively
    • Requirements: 1.1, 1.2, 1.3, 1.4, 2.2
    • Boundary: Event Echo Preamble Deduplicator
  • 2. Validation: regression and real-transcript verification

  • 2.1 Verify every other REPL command and mode's existing behavior remain unchanged outside the preamble's own deduplication

    • Confirm which events are echoed, event ordering, event content, and every other REPL command's behavior and output match their pre-feature baseline exactly except for the preamble line's now-conditional printing; confirm no scheduling decision or simulation state changed as a result of this feature
    • Observable: the existing REPL test suite's pre-existing assertions all still pass, updated only where a specific assertion pinned the old always-print-preamble shape for two events that legitimately share rendered context (each such update documented with which acceptance criterion justifies it), and a step-mode transcript comparison against the pre-feature baseline shows no textual difference outside the preamble line's presence or absence
    • Requirements: 2.1, 2.3, 2.4
  • 2.2 Run the full scheduler test suite and re-verify against a realistic multi-event transcript

    • Observable: the full test suite passes with no regressions, and a step/continue pass over a transcript containing several consecutive same-context events shows the preamble collapsing to one line per distinct context while every event's own content line still appears in order
    • Requirements: 1.1, 1.2, 1.3, 1.4, 2.1, 2.2, 2.3, 2.4