Files
browser/openspec/changes/improve-server-terminal-log-window/specs/bounded-server-log-view/spec.md
T

2.9 KiB

ADDED Requirements

Requirement: Server SSE history is globally bounded

The Platform SHALL interpret the server log SSE historyLimit as a total recent-entry budget across all streams, default it to 100 entries, and cap it at 10,000 entries. It MUST NOT load or transmit the complete durable history when opening a browser stream.

Scenario: Terminal opens with the default window

  • WHEN an authorized operator opens /api/v1/server-instances/{id}/logs/events without historyLimit
  • THEN Platform replays no more than 100 recent entries total across that server's streams
  • AND the replay contains the newest available entries rather than starting at sequence one

Scenario: Requested history is capped

  • WHEN a client requests a historyLimit greater than 10,000
  • THEN Platform limits the total replay to 10,000 entries
  • AND it does not perform an unbounded history query

Scenario: Replay order is chronological

  • WHEN multiple streams have entries in the bounded history window
  • THEN Platform emits the selected entries in ascending timestamp, sequence, and stream-ID tie-break order
  • AND emits ready only after the bounded replay completes

Requirement: Management terminal follows the latest output

The management terminal SHALL begin with the output viewport at the newest rendered line and remain pinned to the bottom while follow mode is locked. User scrolling away from the bottom SHALL unlock follow mode, and scrolling back to the bottom SHALL lock it again.

Scenario: Initial history opens at the newest line

  • WHEN the terminal receives its initial bounded history
  • THEN the output viewport scrolls to the bottom after the lines render
  • AND new log events continue to appear without moving the viewport away from the newest line
  • AND the terminal requests no more than 500 initial history entries while retaining up to 10,000 rendered lines as live output arrives

Scenario: Operator inspects older output

  • WHEN the operator scrolls above the bottom threshold
  • THEN follow mode unlocks
  • AND incoming log events are retained in the buffer without forcing a scroll

Scenario: Operator returns to live output

  • WHEN the operator scrolls back within the bottom threshold
  • THEN follow mode locks again
  • AND subsequent incoming log events keep the viewport at the bottom

Requirement: Browser terminal history is retained in a fixed window

The management terminal SHALL retain and render at most 10,000 lines, evicting the oldest lines when new system, command, or log lines exceed that bound. Historical loading MUST use only the bounded SSE replay and MUST NOT issue a full-history request.

Scenario: Buffer exceeds the retention window

  • WHEN more than 10,000 lines have been received or generated
  • THEN the terminal removes the oldest lines
  • AND the newest 10,000 lines remain available for display