Skip to content

fix(QuickFiler): use 24-hour time format for session-metrics timestamps (#645) - #755

Merged
drmoisan merged 11 commits into
mainfrom
bug/quickfiler-session-metrics-twelve-hour-time-format-645
Sep 3, 2026
Merged

fix(QuickFiler): use 24-hour time format for session-metrics timestamps (#645)#755
drmoisan merged 11 commits into
mainfrom
bug/quickfiler-session-metrics-twelve-hour-time-format-645

Conversation

@drmoisan

@drmoisan drmoisan commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Suggested title

fix(quickfiler): render session-metrics time-of-day as 24-hour HH:mm (issue #645)

Summary

  • Fixes three ambiguous 12-hour .NET time-of-day format strings ("hh:mm", no AM/PM designator) in the QuickFiler and EFC session-metrics CSV writers, changing them to unambiguous 24-hour "HH:mm".
  • Every session-metrics row written since the format was introduced carried an indistinguishable time (14:30 rendered identically to 02:30); this change alters the emitted CSV's time-of-day column content going forward.
  • Updates the three dependent test-literal/doc-comment sites so the existing regression tests continue to assert the corrected rendering.
  • No CSV field order, field count, or unrelated field content changes; no CultureInfo.InvariantCulture argument was added to the fixed call sites (that gap is tracked separately as issue Bug: quickfiler-date-time-format-missing-invariant-culture #742, intentionally out of scope here).
  • A repository-hygiene defect discovered during review (an absolute local file path and Windows account name leaking into two committed Cobertura coverage-evidence XML files) was found and remediated in a separate, self-contained commit before this PR was opened.

Why

The QuickFiler and EFC session-metrics writers used the .NET custom format string "hh:mm" for the time-of-day column. hh is the 12-hour-clock specifier, and the format carries no tt (AM/PM) designator, so an afternoon timestamp such as 14:30 renders as 02:30, which is byte-identical to an early-morning 02:30. The emitted CSV is a real, human-consumed artifact (read by a maintained spreadsheet outside this repository), so the defect is a silent correctness problem in production output, not merely a display nuisance. The fix is a minimal format-string substitution with no other logic, control-flow, or field-order change.

What Changed

Core fix (production code):

  • QuickFiler/Controllers/QfcHomeController.Metrics.cs — line 48 (dataLineBeg interpolation) and line 127 (curTimeText assignment): "hh:mm""HH:mm".
  • QuickFiler/Controllers/EfcHomeController.Metrics.cs — line 96 (curTimeText assignment): "hh:mm""HH:mm".

Tests:

  • QuickFiler.Test/Controllers/QfcHomeControllerMetricsTests.cs — updated the asserted literal in two test methods (WriteMetricsAsync_UsesInjectedClock_ForDateAndTimeStamps, QuickFileMetrics_WRITE_UsesInjectedClock_ForDataLine) and their doc-comments from "hh:mm" to "HH:mm".
  • QuickFiler.Test/Controllers/EfcHomeControllerMetricsTests.cs — updated the asserted time-of-day literal in BuildQuickFileMetricLines_WithMovedMailItems_FormatsMetricLine from 01:05 to 13:05 (matching the fixture's MetricsNow = 2026-07-04 13:05:00 under the corrected 24-hour rendering).

Evidence-hygiene remediation (separate commit, no production/test code):

  • Redacted an absolute local worktree path and Windows account name (2,007 occurrences per file) that leaked into two committed Cobertura coverage-evidence XML files during the delivery process. Substitution only; both files re-verified as well-formed XML after the change.

Docs:

  • docs/features/active/quickfiler-session-metrics-twelve-hour-time-format-645/ — issue, spec, research, atomic plan, remediation plan, and full evidence trail (baseline captures, QA-gate results, regression-testing verification, two full policy/code/feature review cycles).

Architecture / How It Fits Together

No architectural change. Both writers construct a CSV data line by string-interpolating a DateTimeOffset/DateTime value obtained from an injected clock (TimeProvider or an injected clock factory, not the wall clock) through .ToString("HH:mm") instead of .ToString("hh:mm"). The change is confined to the format-string literal at each of the three call sites; the surrounding control flow, CSV field composition, and clock-injection seam are unchanged.

Verification

Completed (from evidence artifacts in this branch):

  • CSharpier format/check on the four in-scope files: EXIT_CODE: 0 (no reformat needed).
  • Analyzer rebuild (msbuild /t:Rebuild /p:EnableNETAnalyzers=true /p:EnforceCodeStyleInBuild=true): EXIT_CODE: 0.
  • Nullable rebuild (msbuild /t:Rebuild /p:TreatWarningsAsErrors=true): EXIT_CODE: 0.
  • Scoped regression run (the two QfcHomeControllerMetricsTests methods and the EfcHomeControllerMetricsTests fixed-clock test): 0 failed, both before and after the source edit.
  • Full QuickFiler.Test assembly run (coverage-enabled): 1312/1312 passed.
  • Scope-boundary diff check: only the four in-scope source/test files and this feature's docs/ tree are touched; no file under QuickFiler/Legacy/, TaskVisualization/TaskViewer.Designer.cs, .claude/**, config/blast-radius.json, or config/orchestration-routing.json appears in the branch diff.
  • Two full policy/code/feature-audit review cycles (pre-remediation and post-remediation reaudit) both independently re-derived these results; the reaudit additionally confirmed the evidence-hygiene fix removed all 2,007 leaked-path occurrences per file with zero regression to the production fix.
  • Repository-wide C# coverage (23.8225%) is below the repository's stated floor, but is unchanged from this branch's own baseline (Delta = 0.0000 percentage points) — a pre-existing, repository-wide condition unrelated to this change; the three changed lines and their four dependent test-literal updates are covered by the existing, passing tests named above.

Recommended:

  • CI's standard build/test pipeline for this branch (not run interactively as part of this delivery).

Backward Compatibility / Migration Notes

This change alters the emitted session-metrics CSV: the time-of-day column now renders on a 24-hour clock (HH:mm) instead of the previous ambiguous 12-hour rendering (hh:mm, no AM/PM designator). Any downstream consumer of this CSV (the maintained spreadsheet referenced in the linked issue) should be aware that afternoon/evening timestamps will now render as digits >= 13 (e.g., 14:30 instead of the previously ambiguous 02:30). No column is added, removed, or reordered.

Risks and Mitigations

  • Risk: A downstream consumer parses the time-of-day column expecting 12-hour values. Mitigation: the column was always intended to be unambiguous; this fix corrects a pre-existing correctness defect rather than introducing new behavior, and the change is called out explicitly here and in the linked issue.
  • Risk: The evidence-hygiene remediation's substitution could have corrupted the Cobertura XML. Mitigation: both files were verified well-formed XML after redaction, and their filename="..." attribute count was confirmed unchanged before/after (value-only substitution, not a structural rewrite).

Review Guide

Suggested order:

  1. QuickFiler/Controllers/QfcHomeController.Metrics.cs and QuickFiler/Controllers/EfcHomeController.Metrics.cs — the three one-line format-string changes.
  2. QuickFiler.Test/Controllers/QfcHomeControllerMetricsTests.cs and QuickFiler.Test/Controllers/EfcHomeControllerMetricsTests.cs — the matching test-literal updates.
  3. docs/features/active/quickfiler-session-metrics-twelve-hour-time-format-645/spec.md — acceptance criteria (all 10 checked off) and scope boundary.
  4. The evidence tree, if a detailed audit trail is wanted; it is large (Cobertura XML files are the bulk of the diff by line count) but mechanical.

Follow-ups

GitHub Auto-close

  • None (GitHub CLI was unavailable when this PR context was collected, so the closing reference could not be verified against live issue metadata in this environment; this branch and its docs/features/active/quickfiler-session-metrics-twelve-hour-time-format-645/ folder target issue Bug: quickfiler-session-metrics-twelve-hour-time-format #645 — add Closes #645 when opening the PR if the issue-linking convention is confirmed at that time.)

drmoisan and others added 11 commits September 2, 2026 09:53
…ormat fix

Preparation-mode delivery for GitHub issue #645: issue.md, spec.md,
research findings, and a preflight-cleared atomic plan for changing the
three ambiguous "hh:mm" session-metrics format strings to "HH:mm" in
QfcHomeController.Metrics.cs and EfcHomeController.Metrics.cs, plus the
matching test-literal updates. Atomic execution is deferred to a later
parallel-orchestrator run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LTjXvNFHVh7Fo7kYGgWsx2
…r stops misreading them as writes

The parallel-scheduling blast-radius harvester reads any backtick-delimited,
whitespace-free repository-relative path as a claim that this item writes
that file, with no notion of surrounding polarity or context. spec.md and
the plan backticked several categories of non-write paths: the Claude
runtime tree, the Codex mirror tree, the dot-agents tree, and the two
published config files (all declared shared surfaces), plus the
out-of-scope survey sites for the adjacent issue #742
(invariant-culture) defect, including a TaskViewer designer file under
the TaskVisualization project. The harvester was reading all of these as
write claims, producing false contention with every other item in the
bugs-2026-09-02 parallel run and a false TaskVisualization-module
placement for this item.

This is a text-presentation-only revision:
- Adds a "## Write Set" section to spec.md naming exactly the four files
  this plan's diff creates, modifies, or deletes: the two QuickFiler
  home-controller metrics production files and their two corresponding
  test files.
- Removes the Markdown backticks around every exclusion path, forbidden
  path, already-correct/no-change survey site, and context reference in
  spec.md and the plan, rewriting each as plain prose while preserving
  its sentence meaning exactly. The two glob-suffixed exclusion paths
  (.claude/** and .codex/** and .agents/**) have their trailing ** escaped
  as \*\* to prevent Markdown from reading them as bold-emphasis markup
  once the surrounding backticks are gone.
- Updates plan.md's P5-T7 AC6 check-off task to quote the revised,
  de-backticked spec.md line verbatim, so the executor's literal
  string-match instruction still succeeds.

No task, acceptance-criterion substance, command, or evidence path
changed. Re-validated via the plan MCP validator and a fresh
atomic-executor preflight pass (PREFLIGHT: ALL CLEAR).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LTjXvNFHVh7Fo7kYGgWsx2
…r HH:mm

Changes the three hh:mm format-string literals to HH:mm and updates the three dependent test literals, per issue #645 / spec.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LTjXvNFHVh7Fo7kYGgWsx2
Housekeeping commit, outside this plan's authored task list: the plan file's own check-off of
its last two tasks necessarily post-dates the P5-T13 commit and P5-T14's clean-tree read, so a
supplementary commit is required for the plan file itself to be included in the "everything
committed" state that P5-T14's acceptance text asserts. See the atomic-executor memory entry on
the plan check-off fixpoint for the underlying mechanics.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LTjXvNFHVh7Fo7kYGgWsx2
…ew/reaudit)

Remediation cycle 1: redacted absolute host path from Cobertura evidence XML (commit 099dab6). Records the plan, preflight rounds, execution evidence, the pre-remediation review (12-00), and the post-remediation reaudit (13-00) that found zero blocking findings.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…vidence files (issue #645)

Residual host-path leak from a prior remediation pass that was scoped only to the
committed Cobertura XML files. git grep -i DanMoisan against the committed tree
still found the absolute item-worktree/session-worktree path in
evidence/baseline/p0-t9-tool-restore.2026-09-03T11-24.md (lines 4, 11) and
evidence/baseline/p0-t10-nuget-restore.2026-09-03T11-24.md (line 7). Replaced the
absolute prefixes with worktree-relative paths / a short descriptive phrase,
consistent with the substitution already applied to the Cobertura evidence in
099dab6. Timestamp/Command/EXIT_CODE/Output Summary fields preserved verbatim
apart from the redacted path text. evidence/qa-gates/** and
evidence/remediation-baseline/** were left untouched; those artifacts quote the
finding deliberately as part of the remediation's own evidence trail.
@drmoisan
drmoisan merged commit 495b012 into main Sep 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant