Skip to content

feat(event-log): compare with previous period in the Charts view (Phase 17b, #850) - #998

Open
adamgell wants to merge 55 commits into
feat/event-logs-charts-846from
feat/event-logs-compare-ui-850
Open

adamgell wants to merge 55 commits into
feat/event-logs-charts-846from
feat/event-logs-compare-ui-850

Conversation

@adamgell

Copy link
Copy Markdown
Owner

Closes #850. Part of #823. Stacked on #985 (Phase 14, the Charts view). This branch also carries Phase 17a (#951, the comparison query and aggregator) at 79633cc9, which it is built on, so until #951 merges the diff shows 17a's files too (evtx-comparison.ts, evtx-store.ts, types.ts, evtx-filter.ts and their tests). Review the commits marked (#850).

What it adds

The Charts view gains "Compare with previous period" (spec 8.16), built on 17a's comparison.

  • The control row. Compare, then a label naming the previous period it compares with ("Comparing with {start} to {end} ({zone})", each bound's offset named when the two differ across a clock change), a Clear comparison button, and a status line. While a comparison runs the status shows its progress.
  • Deltas on the tiles. The Errors and Distinct event IDs tiles show the change against the previous period: an up or down arrow (hidden from a screen reader, which hears "Up" or "Down"), the ratio, and "vs prior {window}". A tile says when its sublabel is a comparison delta.
  • Every state says only what is true. Running, complete, partial (17a's gap lines verbatim, with all deltas withheld), unavailable (17a's refusal verbatim), out of date, and cleared. When the current period holds entries that could not be placed, every delta is withheld and the view says why.
  • Out of date. When the clock has moved past the comparison by more than 17a's own tolerance, the comparison is marked out of date, its own bounds are stated, no change is shown, and one action replaces it: "Refresh and compare again" (live: reload the channels, then compare from now) or "Compare again" (files).
  • Files mode measures relative windows from the capture's end (own commit, af4f8bef): a saved capture's "last 24 h" means the last 24 hours it holds. This is the provisional owner ruling (b) on Event Logs UI phase 17a: Comparison query and aggregator #849.

Main modules: evtx-chart-comparison.ts (the pure presentation of every state), useEvtxChartComparison.ts (the hook, active only on the Charts view), EvtxChartsView.tsx (the control row and the tile deltas), evtx-chart-data.ts (the comparative sublabel flag), EventLogWorkspace.tsx (the wiring and the files-mode window anchor).

Evidence rules

  1. The refusal text is 17a's detail, verbatim. The UI branches only on the reason code, never on wording. Tests pin startsWith the spec sentence for priorPeriodNotSpanned and the exact text for noTimedRecords. Long text wraps; it is never cut.
  2. No delta while anything is unknown. A partial outcome withholds every delta and shows its gap lines; entries the current period could not place withhold every delta with a sentence that counts them.
  3. One definition of the current period (currentPeriodOf in evtx-comparison.ts), used by the staleness check and the current-period count.
  4. Live "Refresh and compare again" never shows a delta from the old session: the refresh cancels the old comparison before it reads.
  5. The comparison, its status and the tiles come from one throttled snapshot, together with the load state, the window label and the clock (feat(event-log): Charts view (Phase 14, #846) #985's rule), so a delta never sits beside a figure from another moment.
  6. The current period is counted only for a complete, non-stale comparison on show while Charts is active. It is O(N) per records change in that state (a live tail append, for example).
  7. Accessibility. Compare is focusable while refused, with the reason as its accessible description and as visible text; the tooltip does not read it twice. The status region is always rendered. Every new text size comes from getLogListMetrics; every new text uses Foreground1 or Foreground2, which reach 4.5:1 on the Charts surface in all seven themes (Foreground3 does not in solarized-dark and dracula, so no new text uses it).

Recorded decisions and deviations

  • The previous-period bounds use " to " as the separator, not the spec's dash. The arrow glyphs are literal copy per 8.10, hidden from assistive technology with a visually hidden direction word (D5).
  • Files mode meaning change (C8). Every files-mode relative window (grid, timeline, histogram, "as of" label) is now measured from the capture's end: the latest usable timestamp across all loaded records, independent of channel selection; with no records, the clock. A fresh files load (window All time) is unchanged. A single far-future usable timestamp moves every files window (the ruled behaviour). A veto is a revert of af4f8bef and of the e2e capture 8a51716a, which relies on it.
  • 17a's per-capture shortfall stands with no tolerance: multi-channel exports compare as partial, and rotated archives of one channel are refused.
  • The empty state (no events in the window) hides the control (R13).

Before merge

  • The files-mode window control. A files comparison is reachable today through a saved filter's window, but the filter bar shows the window control only for live sources, so an operator cannot see or reset it in files mode. Phase 5 (feat(event-log): filter row and chip row (Phase 5, #832) #989) shows the window in files mode when a saved filter left one; this branch takes that when feat(event-log): filter row and chip row (Phase 5, #832) #989 is merged in.
  • Regenerate screenshots/event-logs-charts.png and screenshots/event-logs-charts-view.png (the control row adds height) and capture the new screenshots/event-logs-charts-compare-unavailable.png; check the long refusal wraps cleanly.

Known limits

  • A live comparison made after a load longer than 1% of the window (36 s at Last 1 h) is out of date as soon as it lands, because the grid's clock is snapshotted at load end and the comparison's anchor at load start; "Refresh and compare again" then reproduces the same state. It is ruled behaviour (stale is tested before partial) and how feat(event-log): previous-period comparison query and aggregator (Phase 17a, #849) #951's "reads over 36 s are partial" appears in the UI.
  • A refusal names captures by their full source path, so the Charts view shows the capture's file path.
  • Comparing while events load returns "Events are still loading."
  • The cleared notice also appears when a refusal is dropped because what is loaded changed.
  • Existing Phase 14 sublabels in Foreground3 (Events, Warnings, Critical, Chains) miss 4.5:1 in solarized-dark (3.37:1) and dracula (3.03:1). This lane adds no Foreground3 text and leaves them to Phase 14.

Reviews

  • Plan, then GATE 1 (C0 to C5) with a fix round and two verifications (the second also covered 17a rounds 9 to 12).
  • GATE 2 (C6 to C9) review at 8a51716a: 3 low (untested colour and size of two nodes, an inaccurate reachability note, a missing visible space after the arrow). Fixed in b8ee364a, 82186ed6, a5f97762 (nine "offered" assertions used toBeEnabled, which passes for a disabled-focusable button) and 403068f1. Verification at 403068f1: all three closed; one class residual (the two buttons' font sizes unpinned), fixed in cd1739f9.
  • feat(event-log): Charts view (Phase 14, #846) #985's final-fix round was merged in at 4e5430d1 (af7f9db8). One conflict: both lanes throttle the view's inputs; the merged view throttles feat(event-log): Charts view (Phase 14, #846) #985's snapshot carrying this lane's combined chart and comparison input. placedEpochMs is exported again because feat(event-log): Charts view (Phase 14, #846) #985's range tests import it.

Verification

At head af7f9db8cd8d786b7bdd9b67da755d1295520fb3 (#985's final-fix round merged in at 4e5430d1):

  • npx tsc --noEmit: exit 0.
  • npx vitest run --maxWorkers=3: exit 0, 179 files, 3464 tests, no "Unhandled Errors".
  • node --test .github/scripts/*.test.mjs scripts/*.test.mjs: exit 0, 199 pass (with Python 3.12 first on PATH; scripts/verify-macos-release_test.py from release 1.6.3 needs Python 3.11 or later).
  • git diff 4e5430d1 --check: exit 0. No U+2013 or U+2014 in added lines. No real account name or machine identifier in added lines or in git log -p 4e5430d1..HEAD.
  • npx playwright test -c playwright.screenshots.config.ts --list: exit 0, 12 tests in 2 files. The Charts comparison capture ran green in the lane before feat(event-log): Charts view (Phase 14, #846) #985 was merged in (port 1420 checked); it was not re-run after the merge.
  • src-tauri is untouched, so no Rust gates apply.

🤖 Generated with Claude Code

adamgell and others added 30 commits October 10, 2026 20:41
)

The Rust TimeWindow already has a Between variant and evtx_query_channels
accepts it, but EventQueryFilterSubset.time only admitted { kind: "last" },
so the frontend could not name an absolute period. Widen it to the exact
serde shape (kind tag, from and to as inclusive ISO 8601 UTC strings, either
bound optional) and document that a between with neither bound reads the
whole channel. No behavior change for { kind: "last" }.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#849)

Pure half of the comparison module, with no I/O and no store import.

- computePriorWindow: the equal-length period ending one millisecond before
  the current window begins (the service's between bounds are inclusive, so
  ending on the boundary would count that instant twice). All time, an
  unknown window and an unusable anchor return a typed unavailable result
  instead of a window.
- checkFilesCoverage: a capture covers the period when, per source and
  channel, its earliest timed event is at or before the period start and its
  latest is at or after the period end. Events stamped 0 (the native
  parser's fallback for an unreadable timestamp) are never evidence.
- createAggregator: level counts, per-channel counts and the distinct
  (provider, event id) key set, applying the grid's own visibility criteria
  without the time window. Records are counted and dropped, never retained.
- compareLoadedFiles: the files-mode outcome, complete, partial (events with
  no usable timestamp) or unavailable with a reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the stateful half of the comparison module. It still does no I/O and
imports neither Tauri nor the store; the store will own the query transport
and route batches here by request ID.

- beginLiveComparison mints a dedicated request ID (event-log-compare-N),
  ends any comparison in flight or on show, and returns a session the
  caller reports each channel's reply or rejection on. Batches and
  end-of-stream markers arrive through observeComparisonBatch and
  observeComparisonComplete and are aggregated, never retained.
- A channel settles only when its query replied, its end-of-stream marker
  arrived, no batch is missing and the events received equal the events
  reported. Otherwise it waits a bounded grace and settles with the shortfall
  stated. A rejected or unreadable channel is listed as unread, never counted
  as 0, and a comparison no channel could read is unavailable.
- The result is published once, on settling. cancelComparison stops the
  backend read, clears the result and drops every late batch, terminal and
  reply; starting another comparison does the same to the one before it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The record-batch and stream-complete listeners now hand any event carrying a
comparison request ID (event-log-compare-N) to the comparison module and
return, before the load's own request gates. Comparison events are
aggregated and discarded: they never reach pendingBatches, activeRequestIds,
the visible-batch queue, or records, and so never reach the grid, the
diagnosis or the analysis session, which are all derived from records.

comparePreviousPeriod(anchorEpoch) is the entry point the Charts view will
call. Files are compared from the loaded records when they cover the
previous period. A live source is queried once per loaded selected channel
through the existing query commands (local or remote), unbounded, under one
comparison request ID, with the view's pushed-down criteria and an explicit
{ kind: "between", from, to } window.

A store subscription cancels the comparison, stops its backend read and
clears its result when the source, channels, window, view criteria or
loaded generation change, so a comparison never outlives what it compared.

Also renames the module's sourceNotReady reason to notReady, which covers a
load in progress, no source and an invalid event ID filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…period (#849)

The grid counts every selected channel that has records, wholly read or not,
but the comparison queried only the selected channels marked loaded. After a
stopped load (records on screen, channel not loaded) or an automatic load cut
off at its per-channel bound, the current KPIs would count a slice of a
channel while the previous period was read whole or skipped, and the result
would still report complete. That is a ratio of unlike sets.

comparePreviousPeriod now publishes unavailable with the new reason
currentPeriodIncomplete, naming the channels, when a selected channel has
records but is not loaded, or carries the capped-read coverage note. The
note's wording is now one shared suffix so the check and the message that
produces it cannot drift apart. A partly loaded channel that is not selected
is not held against the comparison.

PriorWindow also records the anchor the current window was measured from, so
a consumer whose own anchor has moved can tell the comparison no longer meets
its current window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he load lack (#849)

Review round 1, findings 1, 2, 4, 5, 6, 7, 11 and 12 for the comparison module.

- A capture that stops before the anchor no longer reads as covering the
  current period. Each (source, channel) capture that ends before the anchor
  makes the files outcome partial, with a gap stating how much of the
  current period it lacks. An export taken 20 h before the anchor is partial.
- The load's own holes are carried into the files outcome as gaps: damaged
  chunks, records and XML, the record budget, and sources the manifest could
  not read. A gap in a source whose records are all in unselected channels is
  not held against the comparison; one in a source no record mentions is.
  The coverage doc comment no longer claims a quiet stretch is always a real
  absence of events.
- Provider-description gaps stay ignored only while no search or quick filter
  reads the message text; otherwise an event can drop out of the count for
  text it never had, and the gap is reported.
- The result records the anchor basis (load, tail or clock) and carries a
  notes list. A remote source notes that periods are computed on this
  computer's clock, which is also documented where the bounds are built, as
  is the sub-millisecond sliver the whole-millisecond bound leaves open.
- A channel read in full with no events in the previous period is recorded as
  0, so a read zero differs from an unread channel. A files capture with a
  reported hole is not called 0.
- The running state exposes the events scanned so far, summed across
  channels, from the comparison's progress events.
- Live input now carries the anchor basis, whether the source is remote and
  the current period's gaps; the store passes its existing values until the
  next commit derives them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#849)

Review round 1, findings 1, 3, 4, 6, 8, 9, 10, 11 and 13 for the store.

- A live comparison is anchored at the instant the newest load began, or at
  the latest live-tail batch while a tail is running, never at the
  workspace's moving clock. A criterion change hours after a load no longer
  slides the previous period away from the current one. Each compared
  channel's own read time is recorded when its query is issued (comparison
  reads are not), and a channel read before the anchor was fixed, or at an
  unknown time, makes the result partial with the uncovered span stated. The
  anchor and its basis are recorded in the outcome.
- Gaps the load reported for the compared channels, in either period, and
  any live-tail gap make the result partial. A provider-description gap
  counts only while a search or quick filter reads the message text.
- The window is computed, and All time refused, before the current period
  is checked for completeness, since no load can fix All time.
- A capped or partly read channel still refuses the comparison (reason id
  unchanged), and the copy now names an action that exists: deselect the
  channel, with the automatic load's 2,000 event cap stated. It no longer
  offers a load in full, which no control provides.
- The time zone and column order cancel a comparison only while a quick
  filter query is set, the only case in which they change what it counts.
- A comparison's progress events reach the comparison store as the number of
  events scanned so far, not the load's progress.
- A code comment marks the cancel-before-registration race as unconfirmed on
  Windows.
- Tests: stale end-of-stream marker from a superseded comparison, time zone
  and column invalidation both ways, an export captured 20 h before the
  anchor, a criterion change hours after a load, a running and a stopped
  tail, and the files outcome carrying the load's holes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ompares (#849)

Review round 1 follow-up. Anchoring on the start of the newest request let a
load that added nothing to the comparison move the anchor: after an
automatic load, a stopped Load of Security, and the advised deselecting of
Security, System and Application read as hours short of an anchor that
only the Security load had set.

- Each request's start is recorded when it begins, and each channel is
  stamped with the start of the request that read it. The anchor is the
  latest stamp among the channels being compared, or the latest live-tail
  batch while a tail runs. Channels of one load share a stamp, so the
  concurrency pool starting the last read later produces no false gap, and a
  channel read in an older load still reports how far it falls short.
- countCurrentPeriod counts the current side over the same period the
  previous one meets, [anchor - length, anchor], with the same visibility
  rules. The anchor no longer equals the workspace clock, so a consumer that
  counts its current side from the grid's window would shift it away from
  the previous period and read a decline that never happened.
- A non-positive anchor is refused as an unusable date in the module, where
  it is tested, instead of in the store.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ere they are merged (#849)

Review round 2 for Phase 17a.

- A live tail no longer sets or extends the anchor. It subscribes to events
  that have not happened yet, so the span between a channel's read and the
  tail's start (or between a stop and a restart) is in neither the records
  nor a gap, and anchoring at a tail batch published that span as covered.
  The comparison stays at the channels' reads, the tail's events outside the
  period drop out of countCurrentPeriod, and a non-gap note says "Events
  after <anchor> (live tail) are not included." when the tail appended any.
  The tail basis is gone from the result type.
- Each channel is stamped at its own query invoke and the anchor is the
  EARLIEST stamp among the compared channels. A channel read later has its
  own window starting later, so the first part of the comparison's current
  period is not in what it loaded; that band is stated as a current-period
  gap once it exceeds 1% of the window length. Smaller bands are a
  documented tolerance next to the sub-millisecond note (1% is a policy
  choice recorded for Adam).
- The stamp is private, has no default and no clock fallback, and is written
  only when a current request merges a channel's result (enumerate merge,
  queryChannels and refresh commits), so a superseded load cannot rewrite it
  and comparison reads never reach it. The exported seam is deleted. A loaded
  channel with no recorded read is now an explicit unavailable state instead
  of an anchor taken from the drifting workspace clock.
- A channel is recorded as 0 only when none of the sources that hold it
  reported a hole (files) and only when its stream reported no gap (live).
- currentPeriodIncomplete copy: when every selected channel is listed it says
  no channel can be compared instead of "the other channels"; a channel a
  stopped load left partly read is told to Load it, and Deselect stays for
  capped channels.
- Tests now reach loaded channels only through real loads (a frozen Date with
  the clock moved along while a load settles). New: a tail started after the
  load, a real stopLiveTail, a refresh, a superseded load, a stagger above
  and below 1%, two sources sharing a channel with one hole, lost batches,
  and each copy variant.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…compared (#849)

The currentPeriodIncomplete copy decided whether deselecting a capped
channel would leave anything to compare by looking at every selected
channel. A selected channel that was never loaded holds nothing and is not
compared, so "Deselect Security to compare the other channels" could be
followed by a Compare that found no channel at all.

The check now looks at the channels that are compared (selected and
loaded) and at the ones Load would bring in. When none would remain it says
no channel can be compared while every loaded selected channel is at the
cap. The branch that said a capped channel "cannot be compared" next to a
channel still to be loaded is gone: once that channel is loaded it would be
compared, so Deselect is the right advice there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… events from (#849)

Two more ways a channel was recorded as 0 although events of the previous
period might be missing:

- A hole carried from a source no loaded record can place (a source the
  manifest could not read, or one the records never mention) might hold any
  selected channel, but only the channels of captures from a source with a
  gap were withheld. Every other channel was still zero-filled. Now no
  channel is zero-filled while such a hole is carried.
- A visible event with no usable timestamp or level may belong to the
  previous period. The aggregator now records which channels had such events,
  and neither the files outcome nor the live one calls those channels 0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…eteness (#849)

The comparison never counts the tail's events: it is anchored at the
channels' reads and the tail reads only events that have not happened yet. A
gap in what the tail delivered therefore says nothing about the period
compared, and making the result partial for it over-reported. It is dropped
from the current-period gap check; the note "Events after <anchor> (live
tail) are not included." stays and covers whatever the tail did or did not
deliver after the anchor. Non-provider coverage notes on the compared
channels still make the result partial.

The test that expected a tail gap to make the result partial now expects it
to stay complete, and a mutant that counts tail gaps again is killed by it.
The limitation that a later load clears the tail's last-append time while the
tail's events stay on the grid is recorded where the time is declared.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rules (#849)

countCurrentPeriod returned a count for a channel only when it had events,
so a compared channel with none was absent from the current side while the
previous side recorded 0 for the same kind of channel. A reader could not
tell "current 0" from "unknown", nor which channels were compared.

The result now publishes comparedChannels, in order, for both modes, and
channelsWithGaps: the compared channels whose count of 0 cannot be trusted
because of a hole in what was read, in either period (a stream that lost
batches, a coverage note on the channel, a missing start, a damaged chunk,
a capture that stops short of the anchor, or a hole in a source no record
can place). countCurrentPeriod takes the result and records 0 for a
compared channel only when it is not in channelsWithGaps and nothing in it
could not be placed in time; otherwise the channel stays absent.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…on-delivered channel (#849)

Only a record's timestamp decided whether the tail's events fell outside the
current period. A subscription can deliver an event after the load has read
the channel while its own timestamp lies inside the period (a collector's
ForwardedEvents, or a machine whose clock runs behind), so the tail appended
it, countCurrentPeriod counted it, and the note said the tail's events were
not included.

The tail listener now marks the records it appends and countCurrentPeriod
sets them aside whatever their timestamp, so the note holds by construction.

A comparison of ForwardedEvents carries a note, not a gap, that events
written to it after the read are not counted, so the current period can be
low against the prior period, which is read later and includes its own late
arrivals.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… sides (#849)

The start band assumed the service evaluates a channel's window at the
instant its query is issued. It evaluates it after the invoke, at a time
this side does not observe, so the anchoring channel's band was always
computed as 0 and a long read could hide up to its own length of the start
of the current period.

Each channel now records when its read was issued and when its invoke
resolved, written at the same guarded merge sites as before. The window was
evaluated somewhere between the two, so a channel lacks at least
(issued - anchor) and at most (replied - anchor) of the comparison's
current period; for the anchoring channel that is nothing to the length of
its own read.
- most within 1% of the window: nothing is stated, as before;
- least beyond 1%: stated as missing, as before;
- only the most beyond 1%: stated as possible ("X may be missing up to N at
  the start of its current period: the service evaluated its window at some
  point during a read that took M"), which makes the outcome partial and
  withholds a zero for the channel.
Both statements are capped at the whole window. The anchor stays at the
earliest issue time. The unmeasured lag is stated, never assumed zero.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d only when merged (#849)

- Files mode capped each cause of gap lines at five and counted the rest,
  but live mode listed every line. A load of hundreds of channels through a
  pool of four makes most of them begin late, and each added a line. The
  current-period causes (certain missing starts, possible missing starts, and
  the load's reported gaps) are now passed grouped by cause and limited on
  their own with the same "and N more not shown." form, as are the lines of
  the channels' own streams and the failure detail built from them. The
  count of untrustworthy channels is unaffected by the limit.
- The stamp-at-invoke mutant survived: a superseded load's pool can invoke a
  queued channel after the current load has read it. A test now has Load A's
  fifth channel invoked after Load B read it, and asserts the anchor is B's
  read, not A's later invoke.
- Comments that described the replaced anchor now say where the period ends,
  what the anchor is, and that the service's evaluation instant is not
  observed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…atever their time (#849)

The anchor's comment still said events the tail appended after it are
outside the period. Since records the tail appended are set aside by
identity, a late-delivered event with a timestamp inside the period is not
counted either.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ed channel (#849)

The ForwardedEvents note said "prior period" where every other statement
says "previous period".

The live test for an event that could not be placed in time did not assert
channelsWithGaps, so dropping the unplaced channels from that list survived.
It now asserts the channel is listed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…emselves (#849)

The note that the live tail's events are not included was derived from the
time the tail last appended, which every load clears. A Load of another
channel tears the tail down but keeps the rows it appended to the channels
that load does not read, so those rows stayed on the grid, were still set
aside by countCurrentPeriod, and the result lost its only statement that
on-screen events of the compared channels are left out. The old wording
("Events after <anchor>") also did not describe a late row stamped before the
anchor.

The note now counts the compared channels' records the tail appended
(isTailAppended) and says so: "N events the live tail appended to the
compared channels are not counted in the current period." It no longer
depends on the tail running or on any time, and the last-append time and its
known-limitation comment are gone. Rows the load read, and rows the tail
appended to channels that are not compared, are not counted.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rom a drifting count (#849)

The note counted the tail rows of the compared channels once, when Compare
ran, and kept the number while the tail went on appending. A comparison
made before the first append had no note at all, and one made after one
row said "1" while the grid went on to hold hundreds that the count set
aside.

countCurrentPeriod now returns tailExcluded: how many of the compared
channels' tail-appended rows it set aside, from the same records as its
counts and under the same criteria (selectVisibleRecords without a time
window, so rows the view's selection, levels, event IDs, search or quick
filter hide are not counted, nor are rows of channels that are not
compared). A consumer states the number from there, so it cannot disagree
with the counts.

The result note carries no number: "Events the live tail appends to the
compared channels are not counted in the current period." It appears when a
compared channel holds tail-appended rows, which a later load keeps for the
channels it does not read, or is being tailed at Compare time, so a
comparison made before the first append announces them too. The comment on
the tail marking now says exactly what holds by construction.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…849)

A Clear removes a channel's records, tail rows included, and drops it from
the loaded channels without beginning a load, so none of the keys the
comparison watches changed. A settled comparison survived it and kept
listing the cleared channel, and a recount over the records would have
recorded a trusted 0 for a channel with no records, against its full
previous-period count: a decline that never happened.

Every path that removes, replaces or re-reads a compared channel's records,
or changes which channels are loaded, was audited. A load, a refresh, a
source switch and a reset each begin a request and bump loadGeneration or set
a key already watched; stopping the tail removes no rows; the Clear was the
one path with no key. The store now cancels when a channel the comparison
depends on is no longer loaded, and leaves the comparison alone when any other
channel is cleared or loaded, which it can tell apart from the comparison
itself: the running state now carries the channels compared, and
comparedChannelsOfComparison reads them from a running or settled comparison.

The invalidation table gains rows for a Clear of a compared channel, a
refresh, a Load of another channel and a reset, in flight and finished, and a
test that clearing a channel that is not compared cancels nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…quick filter (#849)

The field's documentation says a tail row the view's criteria hide is not
counted, but only the level and channel criteria were tested, so a call that
dropped the search and the quick filter survived. Two cases now each hide one
tail row of a compared channel, one with a search and one with a quick
filter.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The note that the tail's rows are not counted is decided when Compare runs.
A tail started after Compare appends to the compared channels under a
result whose notes are empty, whether the result has settled or its scan is
still running, and Compare itself is allowed while a start is awaiting the
service.

Starting a tail changes what is on screen for the compared channels, so it
cancels the comparison. The cancel is keyed on tailRequestId becoming a new
non-null value, not on the tail's channels: the tail listener writes a new
Set on every append and rewrites tailRequestId with the same string, so an
append under a tail that is already running, and stopping a tail, leave a
comparison alone. A start that lands after Compare was made cancels it when
it sets tailRequestId, and a denied Clear that restarts the tail cancels
too, which is acceptable over-cancelling.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e the Clear test on the sets (#849)

- A settled outcome that could not be made holds no result and names
  channels it refused: a capped one, an unstamped one. Clearing one of them
  left it on show advising a deselect of a channel that now holds nothing. It
  depends on every channel, so it is cancelled by any change to what is loaded.
- The Clear test was written as "a compared channel is not in loadedChannels"
  behind a check that the set was replaced. For files, which never fill
  loadedChannels, the first half is always true and only the identity check
  kept every update from cancelling a settled files comparison. It is now
  stated directly: a compared channel that was loaded and no longer is.
- The comment said a comparison is left alone when any other channel is
  cleared or loaded; a load cancels it through loadGeneration, which the
  invalidation table already asserts.

Tests: an unavailable outcome that names a capped System is cancelled by a
Clear of System and survives updates that change nothing it names; a settled
files comparison survives a row selection, a sort and a grouping.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…arison cancel (#849)

The tail-start cancel was keyed on tailRequestId becoming a new non-null value. A first batch
from one channel sets tailRequestId before the start has landed for the others, so a comparison
made in between had no note, and the landing then changed only tailChannels. The subscription now
also cancels when a channel the comparison depends on enters tailChannels; an append under a
landed tail adds no channel and a stop removes them, so neither triggers it.

The non-compared Clear test now clears a channel that is loaded and not selected, in flight and
settled, so a predicate that cancels on any loaded channel leaving fails. The doc of
comparedChannelsOfComparison says an outcome that could not be made returns no channels and is
cancelled by the store on any change to what is loaded.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… and a single channel (#849)

The set-based cancel on a compared channel entering tailChannels was pinned only for a settled
comparison whose two compared channels enter in one write. Two edits kept the suite green:
restricting the branch to the settled phase, and changing some to every behind a non-empty guard.

The new test runs a comparison, waits for its two queries without settling, then delivers System's
own early batch so one compared channel enters tailChannels on a write of its own with the tail
request unchanged. The comparison goes idle and its read is cancelled; landing the held starts and
resolving the queries leaves it idle. No production change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…iting on its reads (#849)

comparePreviousPeriod awaited the whole query pool before session.done, so a cancelled or
superseded comparison kept its promise pending until every in-flight backend scan returned. The
scan is unbounded and the cancel is best effort, so a caller stayed busy after the comparison went
idle.

The call now races the pool against session.done, which a cancel, a supersede and a settle all
resolve, and still awaits session.done on a normal finish so it returns only once the comparison
has settled. The abandoned pool drains on its own: the session drops every late reply, and a
rejection it ends in is logged at debug level and not left unhandled.

The tests that resolved abandoned queries only to let the run settle now await the run first and
resolve the queries after, so they also show a late reply is dropped once the call has returned.
New tests cancel and supersede a comparison whose queries never reply, with a late delivery, reply
and rejection and no unhandled rejection, and pin that a normal finish waits for the settle.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…n a comparison (#849)

createAggregator counted every visible row into the distinct (provider, event id) set and the
per-channel counts. An archived text-log line is shaped like a record but carries event ID 0, its
component as the provider and its source label as the channel, so a "new IDs" figure read from the
set would count a pseudo identity the Distinct IDs tile never counts.

One shared predicate, isEventRecord in evtx-filter.ts, decides by the record's origin (never by an
event ID of 0, which an event may carry). The aggregator adds a record to distinctEvents and
channels only when it is an event. The total and the levels still follow the visible rows, as the
Charts tiles count them (the Errors tile includes text-log errors), so a delta sits beside the
figure it is compared with.

A text log stays a capture, because its lines are counted in the levels and so must span the
previous period. FilesCapture gains holdsEvents, and a capture without events is neither a compared
channel nor given a zero count, which would have been a false zero now that its rows are not in the
channel map.

Tests are RED first with an originKind "log" fixture shaped as archive.rs builds it. Ten scripted
mutants (log rows entering the identity set, the channel map, or leaving the levels; the predicate
reading the event ID or inverted; holdsEvents never or always set; the zero-fill and the compared
list ignoring it; coverage skipping text logs) are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
#850)

Step 0 audit of EvtxChartsView.tsx and evtx-chart-data.ts before the comparison work. Neither file
has an unused import or local (noUnusedLocals is on), a debug log or a dead prop. Two value exports
had no importer anywhere, tests included: HEAT_STEP_COUNT (read only as a default parameter here)
and placedEpochMs (read only by hourOfDay). Both are made private. No behaviour change.

Left as they are and reported: six type exports (EvtxChartKpiId, EvtxChartChannelBar, EvtxChartTopId, EvtxChartHeatRow, EvtxChartHourly, EvtxChartPeak) that only describe the data model's own shape,
and the exports whose only importer is a test (HEAT_EMPTY_CELL, CHART_DATA_THROTTLE_MS,
EvtxChartsViewProps, CHANNEL_ROW_LIMIT, hourOfDay, heatStepIndex, buildHideRuleQualifier). The
broader export audit stays with Phase 20 (#854).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Brings in the previous-period comparison query and aggregator (#849, PR #951), including 17a's
round 9: a text-log line is no event identity and no channel in a comparison. The two lanes share
the merge base 810d117 and touch no common file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
adamgell and others added 25 commits October 18, 2026 07:37
…re end are defined once (#850)

Three small, pure definitions in evtx-comparison.ts that the Compare UI reads, each with its
tests written first.

resolveFilesPrior is the first two steps of compareLoadedFiles (the previous period, then whether
the loaded captures span it), now shared. A control that decides whether Compare can be offered and
the comparison that then runs answer from this one function, and a table test pins that they agree
on every kind of input the comparison distinguishes.

isComparisonStale says whether the instant a figure is measured from has drifted from the
comparison's anchor by more than the tolerance this module already treats as silent for the start
of a channel's current period. That tolerance becomes one helper that channelStartGap and the stale
test both call, so there is no second constant. An unusable instant is stale, never current.

filesWindowAnchor is the single definition of a capture's end: the latest usable timestamp among
all the loaded records whatever the channel selection, or the clock when none can be placed. It is
pure and unused until the workspace adopts it in its own commit.

Eleven scripted mutants (the boundary, the sign, a second constant, an unusable instant counted as
current, a diverging start-band tolerance, a skipped coverage check, all time ignored, the earliest
or an unplaced timestamp as the capture end, no fallback, always the clock) are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…definition (#850)

comparePreviousPeriod built the visibility object inline. Whoever counts the current period from a
published result (countCurrentPeriod) must count under the very same criteria, or the two sides of
a delta are taken under different rules. comparisonVisibility is that object, exported and used by
comparePreviousPeriod, so the Compare UI reads it from the same place the store does.

Tests written first: each field comes from its own key (no swapped or copied criteria), and a
files comparison made through the store equals compareLoadedFiles under comparisonVisibility.
Five scripted mutants (a dropped visibleColumns, a copied channel selection, swapped search and
event IDs, a fixed clock mode, the store counting under other levels) are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…Ds tiles (#850)

evtx-chart-data derives the two delta sublabels of spec 8.10 from a comparison the caller hands in
only when it is complete and current. Without one both sublabels stay omitted, never estimated
(D15), and no tile carries a trend.

Errors: "<up> r x vs prior <window>" or "<down> r x vs prior <window>", where r is the current count
over the previous one for an increase and a decrease alike, to one decimal below 10 and whole from
10, thousands grouped. A previous count of 0 has no ratio and reads "n new vs 0 in prior <window>"
(never an infinity); 0 against 0, 0 against n and equal counts read as the two counts; a ratio that
would round to 1 or to 0 is also stated as the two counts, so an arrow never sits beside a number
that says nothing moved. Distinct event IDs: "n new vs prior <window>", a set difference of the
two periods' IDs, not a difference of sizes. The window is named by chartWindowLabel, the Events
tile's own words. The delta reads the comparison's own current count; the tile's value is untouched.

A trend field lets the view give the glyph an accessible direction. The text-log rule now has one
definition: countTextLogSources, loadedChannelCountFor and the build all ask isEventRecord.

Tests are RED first, including a grid over every pair of counts 0..40 that never yields an
infinity, a NaN or an undefined and always agrees the arrow, the trend and the numbers. Fifteen
scripted mutants (a divided zero baseline, swapped arrows, an inverted decrease, a rounding
collapse not handled, a size difference or a reversed set difference for new IDs, a fixed window
label, the tile value as the current side, floor for round, no grouping, a moved threshold, a
dropped trend, text-log rows as event IDs, a delta on another tile) are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ntation (#850)

evtx-chart-comparison turns the comparison store's published state, the availability of the
Compare control and the clock the tiles are measured from into plain text and flags, so the Charts
view renders states and decides nothing.

Not compared: Compare, disabled with the comparison's own reason when the prior period cannot be
defined or the loaded files do not cover it. Running: the previous period named with its zone,
progress as events scanned so far, no delta. Complete and current: the label, the comparison's
notes as written, the tail events left out counted from the same tally, and the only state that
hands the delta sublabels their two periods. Partial: every delta withheld and the comparison's
own reasons listed as written. Unavailable: "Comparison unavailable: " and the comparison's detail,
never reworded. Out of date (the tiles' clock has drifted from the anchor by more than the
comparison's own tolerance): what the comparison covers against what the tiles now show, no delta,
and a re-compare that refreshes first for a live read, because comparing again alone would keep
the same anchor. Cleared: one quiet line.

The current period is counted lazily, once, and only for a complete comparison that is still
current. Tests are RED first and include a pass over every state for an infinity, a NaN, an
undefined or a dash in any text, that only a complete current comparison has a delta, and that
Clear is offered exactly while a comparison runs or is on show. Eighteen scripted mutants (a delta
while running or on a partial result, the stale test skipped or ordered after partial, a fixed
recompare label, a reworded refusal, a dropped reason, an always-enabled control, dropped gaps or
tail line, counting for a partial result, Clear when idle, a fixed clock, a dash separator, a
printed NaN, the prior count from the current side, an always-on cleared notice, no progress
count) are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… it (#849)

Files comparisons can now include archived text logs (their lines count in the levels), but the
gap and refusal strings still called every row an event and refused a whole comparison without
saying which capture was at fault or what to do. The Compare UI shows these strings verbatim.

Gaps: the unplaced count of a files comparison says "entries" (events and text-log lines are
counted together, as the totals are); a live comparison reads no text log and still says events.
The shortfall line names a capture by its file and channel, or by its name once for a text log,
and says "events" or "log lines" by what it holds.

Refusals from checkFilesCoverage: nothing loaded says "No entries are loaded for the selected
channels." A capture with no timed entry, or captures that do not span the previous period, are
named (all that fail for the reason given, five at most and the rest counted), with the spec's
sentence "The loaded files do not cover the previous period." kept first and unchanged. Each ends
with the one action that exists: "Deselect <channels> to compare the other channels." when a
capture of another channel is loaded, and "No other selected channel has entries to compare."
when none would remain (a selection is by channel, so a channel's other sources go with it).

Doc drift: ComparisonResult.comparedChannels is event captures only in files mode.

Tests are RED first, one per string and per branch (eighteen failed); fifteen scripted mutants
(each string reverted or generalised, the noun fixed, the advice ignoring what remains, remaining
judged by capture instead of channel, the spec sentence dropped, a single capture named, the cap
moved, failures of every kind collected, a text log named twice, the live noun changed) are each
killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Brings in 17a's reworded gap and refusal strings: a capture is named, what it holds is said
(events or log lines, entries for the mixed count), and each refusal ends with the one action that
exists. The Compare UI shows these strings verbatim. The lane's resolveFilesPrior test, which pinned
the old strings, is updated in the next commit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The merge of 17a round 10 reworded the files refusals: nothing loaded says entries, and a capture
that does not span the previous period is named after the spec's sentence, with the one action that
exists. The lane's resolveFilesPrior test pinned the old strings. It now pins the new ones, so the
words the disabled control will show are the words the comparison gives. Test only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ition (#850)

countCurrentPeriod inlined [anchor - length, anchor], and the Compare UI's out-of-date copy would
have restated it. currentPeriodOf(prior) is that period, exported and used by countCurrentPeriod,
so the count and any copy that says which period was compared read the same bounds. Documented on
PriorWindow.anchorEpoch.

Tests first: the period for 1h, 24h, 7d and 30d, that the previous period ends one millisecond
before it starts, and that the current side is counted over exactly it. Four scripted mutants (the
start or the end moved one millisecond, the length doubled, the previous period counted instead)
are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…k change (#850)

priorLabel and staleStatus printed both bounds in the operator's local clock but named one offset,
taken at the first bound (the label) or the anchor (the stale copy). When a previous period crosses
a daylight-saving change the other bound is printed in an offset the copy does not name: in US
Eastern, "Comparing with 2026-10-27 08:00:00.000 to 2026-11-03 06:59:59.999 (UTC-04:00)" reads the
end bound as 10:59:59.999Z, an hour early, so a copy that claims millisecond precision described a
period of 6 d 23 h.

A period is now written by one function: when its two bounds share an offset it is named once, as
before; when they differ each bound carries its own. The out-of-date copy also names the offset of
the tiles' start, which can differ from the covered period's, and reads the covered period from
currentPeriodOf, the one definition of the current period. In UTC mode the zone is named once as
always.

Tests run under America/New_York with the reviewer's scenario (anchor 2026-11-10T12:00Z, 7 d), the
stale copy across the change, a tiles' start before the change beside a covered period wholly
after it, and the shared-offset and UTC cases. Eight scripted mutants (a single offset named for
differing bounds, the offset named twice when shared, the end bound's offset for both, no offset or
the covered period's offset for the tiles' start, the previous period as the covered one, both
offsets looked up at the start or at the anchor) are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rent reasons (#849)

refusalDetail took its reason from the first failing capture, named only the captures that failed
for that reason, and judged "the other channels" against those alone. When one capture had no
timed entry and another did not span the period, a channel with a refused capture of the other
kind counted as one that would remain, so the advice promised a comparison that did not exist: the
operator deselected the named channel and met a second refusal.

Every failing capture is now collected, whatever its reason. Each reason's captures are named
under that reason's sentence (the spec's sentence "The loaded files do not cover the previous
period." first whenever any capture fails to span the period, then the untimed captures), and the
sentences read the same whichever capture was read first. The advice is built from all of them:
"Deselect X to compare the other channels." only when, with every failing capture's channel
deselected, a selected channel remains, and every capture of such a channel passes. Otherwise it
says "No selected channel can be compared: every one has a capture that ...", worded for what the
captures failed for (does not cover the previous period, cannot show whether it covers it, or
both), which stays true when other channels have entries that cannot be compared. The reason code
is still the first failure's.

The deselect list is capped like the captures, at five, followed by "and N more".

Tests are RED first (fifteen failed, among them the pin that carried the false promise): the mixed
state in all six orders, that the advice is true by deselecting exactly the channels it names and
re-running the coverage, the cap at five, at six and past it, a channel named once, and the reason
code. Fifteen scripted mutants (the advice judged by one reason only, the sentences reordered or
dropped in the mixed state, each nothing-remains wording, something always remaining, the list
uncapped, the boundary or the cap moved, capture order, reasons swapped, a channel named per
capture, the last failure as the reason) are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Brings in 17a's refusal rewrite: every failing capture is named under its own reason with the
spec's sentence first, the deselect advice is made only when a selected channel remains whose
captures all pass, and the deselect list is capped. One lane pin rides inside this merge so that
every commit stays green: the resolveFilesPrior test (evtx-comparison.test.ts) pinned the sentence
"No other selected channel has entries to compare." for a lane whose only channel fails to span the
period; it now pins "No selected channel can be compared: every one has a capture that does not
cover the previous period." (the NONE_UNSPANNED constant the merge brings in).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… is true of every channel (#849)

When no channel remained, round 11 said "No selected channel can be compared: every one has a
capture that ...". The clause is false for a selected channel with no entries at all (an empty
.evtx the parser still selects): it has no capture.

The sentence now reads exactly "No selected channel has entries that can be compared." It carries
no reason, because the sentences before it already name each failing capture and why it fails. It
is true of a channel whose captures fail, of a channel with no records, and a channel with only
passing captures cannot be in that branch.

Two things the review recommended ride with it. The reason code follows the lead sentence:
priorPeriodNotSpanned whenever any capture does not span the period, otherwise noTimedRecords, so
it agrees with the refusal's first words and no longer depends on the order the records came in.
And what a refusal names is sorted by character code, which is the same in every locale, so the
captures, the channels to deselect and which five appear under the cap are the same whatever the
order read.

Tests are RED first (twenty-one failed) and cover the whole grid with an exact string per cell:
unspanned, untimed or both failures, a channel that passes or none, and a selected channel with no
entries or not. Where the refusal says to deselect, removing exactly the channels it names makes
the coverage pass; where nothing remains it is the exact sentence. Sorting is tested in three
orders, by character code against a locale-aware sort, at the cap, and for a channel's several
captures. Fifteen scripted mutants (a reason clause kept or the old sentence restored, the reason
code order-dependent or fixed, the names unsorted, sorted by locale, descending, only after the cap,
or the deselect list unsorted, something always remaining, untimed channels not leaving, a channel
named per capture, the lead sentences swapped or dropped, a late capture no longer failing) are
each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Brings in the final wording of 17a's refusal when no channel is left to compare ("No selected
channel has entries that can be compared."), a reason code that follows the lead sentence, and
character-code sorting of what a refusal names. One lane pin rides inside this merge so that every
commit stays green: the resolveFilesPrior test (evtx-comparison.test.ts) pinned the round 11
sentence for a lane whose only loaded channel fails to span the period; it now pins the new one
through the NONE constant the merge brings in.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… could not be placed (#850)

countCurrentPeriod counts visible entries with no usable timestamp or level nowhere, so a current
figure beside them may be low. The presentation had no field for them and would have formed a
delta from a count that could be short. CurrentPeriodFigures now carries unplacedRecords, and a
complete, current comparison whose current tally has any is "withheld": every delta is withheld
and the status says, in one sentence that only repeats what the tally knows, "N loaded entries
have no usable timestamp or level and could not be placed in the current period, so no change is
shown." The comparison's notes and the tail events left out are kept beside it, and Clear is
offered. Unknown is never zero.

Tests first (three failed): the sentence for one and for several, the notes kept, a count of
zero leaving the delta, and the new phase in the every-state passes. Six scripted mutants
(unplaced ignored, always withheld, not pluralised, the level dropped, notes dropped, the deltas
still carried) are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…850)

The Charts view colours its sublabels with the third foreground, which measures 3.37:1 in
solarized-dark and 3.03:1 in dracula against the Charts surface, under the 4.5:1 a delta needs. The
view must give a delta the second foreground (5.61:1 or better in all seven themes), and it needs
to know which sublabel is one. EvtxChartKpi.comparative is true exactly when the sublabel is a
comparison delta (the Errors tile in its ratio and counts forms, and the Distinct event IDs tile),
and false for every other tile and whenever there is no comparison.

Tests first, with the counts form as well as the ratio form. Four scripted mutants (the flag only
for a ratio, never on the Distinct IDs tile, on the Warnings tile, always on) are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
EvtxChartsView renders the comparison through a prop-driven bar above the KPI grid, right-aligned
(spec 8.10, 8.16): the Compare with previous period button, the "Comparing with ..." label, Clear
comparison with Dismiss12Regular, a live status region, the partial result's reasons and the
comparison's notes. The view reads no store: it takes the presentation input and the three actions,
builds the presentation inside the same throttled snapshot as the tiles, and hands the deltas to
the tiles from that one result, so a delta, its status and the tile beside it are never from two
moments. Absent the prop, no comparison is offered, and the empty state still replaces the whole
view.

A refused or unavailable Compare is disabled but focusable, and its reason is shown as visible
text that is the button's accessible description; the tooltip carries the same words for the
pointer. The reason, a files refusal and every status are the comparison's own words rendered
whole: they wrap at any width (overflow-wrap anywhere, no ellipsis, no fixed width), and the view
never branches on the wording. Out of date offers Compare again (live: Refresh and compare again).

A trend sublabel hides its glyph from assistive technology and says Up or Down. A comparison delta
is coloured with the second foreground, which passes 4.5:1 in all seven themes (the third measures
3.37:1 in solarized-dark and 3.03:1 in dracula); the other sublabels keep theirs and are flagged as
a Phase 14 residual. Every new text size comes from the log list font metrics.

Tests first (28 failed against the old view): every state, the reason pinned by the comparison's
reason code (only a refusal about the period opens with the spec's sentence), wrapping, Clear in
each state, fonts at two sizes, contrast in all seven themes, the throttle moving tile, delta and
status together, and no delta in any state but a complete, current one. Twenty-two scripted mutants
are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ogs workspace (#850)

useEvtxChartComparison reads the comparison's published state and the criteria it was made under,
decides whether Compare can be offered, and supplies Compare, Compare again and Clear to the Charts
view. It adds no rule of its own. Availability is the comparison's: resolveFilesPrior for files
(so a refusal's words, and its reason code, are the comparison's), computePriorWindow for a live
source (so All time is disabled in both modes without a query). The criteria are the store's
comparisonVisibility, and the current period is counted by countCurrentPeriod over every loaded
record, lazily, so nothing is counted unless a complete comparison is on show and Charts is the
active view. The grid's own instant (nowEpoch) is the anchor of a files comparison, the instant a
files refusal is judged at, and the snapshot a comparison is checked against, so all three agree
with the tiles.

Refresh and compare again, for a live comparison, reloads the loaded channels first and compares
from the clock, because comparing again alone keeps the load's anchor; the reload cancels the old
comparison, so nothing of it is shown while the channels load, and the cancel is not announced. A
files comparison is compared again from the grid's instant with no reload. A failed reload is
logged. When the store ends a comparison that the operator did not clear, one quiet line says so
until the next comparison; the operator's own Clear says nothing. Entries the current period could
not place and the tail events it left out reach the view from the same count.

EventLogWorkspace passes the hook the Charts view's activity and the grid's instant.

Tests first (the hook did not exist): availability in both modes and its reason codes, the anchor,
the delta from the whole record set under the comparison's criteria, Clear, the notice, staleness
and re-compare in both modes, the reload order and what is shown while it runs, the refusal after
it, a failed reload, withheld entries, the tail note, and the workspace passing only an active
view and the grid's instant (not the clock). Twenty-four scripted mutants of the hook and the
wiring are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… its end (#850)

Owner ruling (b), in its own commit so a veto is one revert. The workspace's nowEpoch, the instant
the grid, the timeline, the view bar, the "as of" label and the previous-period comparison measure
every relative window from, is now filesWindowAnchor(records, clock) for files: the latest usable
timestamp among all the loaded records, whatever the channel selection, and the clock when nothing
can be placed. A live source is still measured from the clock.

What this changes for the operator, to be said plainly in the PR: in files mode "Last 24 hours" now
means the last 24 hours the capture holds, where it meant the last 24 hours before this computer's
clock (so an export older than a day showed nothing). A fresh files load starts at All time, which
does not use the instant, and is unchanged. One record stamped far in the future becomes the
capture's end and moves every files window. Under the comparison, a files comparison made from the
capture's end can no longer drift from the tiles. Multi-channel exports are still partial under
17a's per-capture shortfall rule, and rotated archives are still refused.

The window follows the source: it is the clock's as soon as the source is live. The existing test
that the window advances when the records refresh pinned files mode on the clock; it now pins a
live source, and a new test pins that a saved capture's window does not follow the clock.

Tests first (one failed against the clock): the capture's last 24 hours however old, All time
unchanged, one far-future record moving the window, the selection not moving it, a live source on
the clock, and the window following a change of source. Five scripted mutants (the clock for a
capture, the capture's end for a live source, the end following the selection, the source missing
from the memo's inputs, the earliest record as the end) are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ath (#850)

The screenshot harness opens the synthetic Event Logs dataset in files mode, so the states the
fixture reaches are the disabled ones, and those are asserted and captured with the real data:

- The existing Charts capture now asserts that files open at All time, where Compare is offered but
  disabled with "All time has no previous period." beside it, and no tile carries a delta.
- A new capture, event-logs-charts-compare-unavailable, sets the window to 30 d through the store
  (the filter bar offers a window for live sources only; the harness already opens its sources that
  way). 30 d holds every record of the 24 hour dataset, so the visible rows and the analysis the
  engine replies were captured for are unchanged. It asserts that the control is disabled and that
  the reason is exactly what the comparison itself says for the loaded records, measured from the
  same instant the grid is, that it opens with the spec's sentence (the reason code is
  priorPeriodNotSpanned), and that no delta is shown. Partial, complete, running, out-of-date and
  refused states need replies the dataset cannot produce and are proved by the DOM tests.

No PNG is committed: the new capture and the two Charts captures are regenerated in the capture
session. The fixtures and their engine replies are untouched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…#850)

The glyph span was hidden from assistive technology without its space, so the Errors delta read
"3x" against the arrow with nothing between them ("the arrow glued to the ratio"). The hidden span
now carries the glyph and its space, the visually hidden direction word keeps its trailing space,
and the ratio follows both, so a sighted reader sees "<up> 3x vs prior 24 h" and a screen reader
says "Up 3x vs prior 24 h".

Tests first (five failed): the visible text with the visually hidden word left out, the spoken
text with the glyph left out, no glyph glued to the ratio, no doubled space, and the down arrow's
two forms. Six scripted mutants (no visible space, no spoken space, the space counted twice, the
glyph read aloud, the direction reversed, the ratio dropped) are each killed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…parison bar (#850)

The colour and size tests rendered a partial state, so comparison-disabled-reason (which needs the
"off" state with the availability unavailable) and comparison-notes (which needs a complete
comparison with tail events left out) were never measured. Each is now rendered in its own state
at two font sizes (13 and 20), and both must carry the second foreground and the size derived from
the log list metrics. The source was already right; this closes the gap in what is proved.

Six scripted mutants (each node in the third foreground, each at a fixed 11px, each at the status
size) are each killed; the fixed 11px is told apart by the larger size. Test only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…by the disabled attribute (#850)

Compare is a disabled-focusable button: when it is refused it carries aria-disabled="true" and no
disabled attribute, so toBeEnabled() passes for a refused button as well. Nine assertions that
meant "Compare is offered" used it, and could not tell the two apart. Each now asserts that the
button does not carry aria-disabled="true" (a missing button fails too).

A scripted mutant that refuses Compare in every state is killed by the view tests (4 failures),
the hook tests (17) and the workspace layout tests (1). Test only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…#850)

The filter bar offers the time window for live sources only, but a saved filter carries one, and
applying it (the Saved list, then setBeforeLoadCriteria) sets the window for any source, so a
window reaches a saved capture today even though the control stays hidden in files mode.

A DOM test drives that route through the real workspace and filter bar: a capture that spans the
previous 24 hours of its own end opens at All time, where Compare is offered but refused and the
window control is not shown; the saved filter with a 24 h window is applied from the Saved list;
Compare becomes available (not aria-disabled) and, clicked, compares the previous 24 h before the
capture's last 24 h, measured from the capture's end and not the clock. The window control is
still not shown. The filter bar is not changed here: Phase 5 shows the window in files mode when a
saved filter left one.

Five scripted mutants (the availability judged at the clock, a saved capture measured from the
clock, Compare anchored at the clock, the saved filter's window not applied, Compare always
refused) are each killed. The test sets its own 30 s limit because the Charts chunk loads cold
here. Test only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ar's buttons (#850)

The size tests measured the label, the status, the reasons and the notes, but not the two buttons.
The action button (Compare, Compare again, Refresh and compare again share it) and Clear comparison
set their text from the log list metrics, and nothing pinned it.

Each is now rendered in a state that shows it (not compared, refused, out of date for files and for
a live source, and complete) at metrics 13 and 20, and its font size must equal the size derived
from the metrics, max(11, f - 1). Six scripted mutants (each button at a fixed 12px, with its style
dropped, and at the small size) are each killed; the fixed 12px is told apart at size 20. Test only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Takes #985's final-fix round. One conflict and one semantic join:
- EvtxChartsView.tsx: #985 throttles a snapshot {input, loading,
  windowLabel} so the load state, the window label and the clock settle
  with the data; this lane throttles {chart, comparison} so a delta and
  its status come from one moment. The snapshot now carries this lane's
  combined input, and the comparison presentation, the chart data and
  the settled clock all read it.
- evtx-chart-data.ts: this lane's Step 0 made placedEpochMs
  module-private (1b50060) when nothing imported it; #985's new range
  tests import it, so it is exported again.

tsc exit 0; vitest 179 files, 3464 tests, exit 0, no Unhandled Errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 1
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added enhancement New feature or request feature New feature labels Oct 22, 2026
@adamgell adamgell mentioned this pull request Oct 22, 2026
4 of 34 tasks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant