Skip to content

Fix Metrics panics on Security runs - #2315

Merged
JacobStephens2 merged 2 commits into
mainfrom
issue-2311
Nov 19, 2026
Merged

JacobStephens2 merged 2 commits into
mainfrom
issue-2311

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Security runs passed outcome classification but were missing from the separately indexed COUNTED list, so reading them panicked every Metrics view.

COUNTED = WORK + ["Pickup run"]
Console kind choices use COUNTED.len()
uncounted kind → skip the outcome row

Closes #2311.

Evidence

Execution evidence

  • Before: cargo test --test metrics security_and_release_outcomes_render_metrics -- --exact
    thread 'main' panicked at src/logs/metrics/outcomes.rs:473:10:
    only work kinds and Pickup runs are counted
    left: Some(101)
    right: Some(0)
    test result: FAILED. 0 passed; 1 failed
    
    After: the same command passes:
    test security_and_release_outcomes_render_metrics ... ok
    test result: ok. 1 passed; 0 failed
    
  • Minimization: Security-only and Security + Release fixtures exited 101 before; Release-only exited 0. All three now exit 0. Against the same faux records, /metrics?window=all changed from HTTP 500 to 200; both kind choices and outcome rows render, the API reports one failed outcome for each, and Playwright reports no browser errors or failed requests.
  • cargo test --test console metrics::security_and_release_outcomes_render_local_and_fleet_metrics -- --exact: 1 passed. Covers local and Fleet HTML, the HTTP API, both kinds, and exclusion of an unknown kind from outcome rows.
  • cargo test --test metrics: 49 passed, 2 ignored subprocess entry points.
  • cargo fmt --check and git diff --check: passed.
  • /usr/bin/time -p scripts/affected-tests main passed the build (113.84s), then stopped on two Inbox visibility timeouts in the Console suite: 266 passed, 2 failed (320.58s; Fleet polling and phone Dismiss/Undo). Both exact cases passed on an isolated rerun:
    node --test --test-name-pattern='Fleet Inbox polls with page subscriptions, retains rows, and fits a phone|Inbox row Dismiss works in needs you with JavaScript on a phone' console/tests/fleet.test.cjs console/tests/inbox.test.cjs
    Result: 2 passed, 0 failed.
  • The complete CI run passed on reviewed head c3871531472ddc5ae59545079147fabd728f89fb, including full Rust coverage, Console and site checks. Reusing these successful same-head checks as documented in docs/testing.md.
  • /usr/bin/time -p cargo nextest run --test-threads 3: intentionally stopped after same-head CI passed. Before SIGINT, 2,278 tests passed with no assertion failures; 3 running tests were interrupted and 2,587 were not run locally (219 skipped by the profile). Local wall time was 3964.31s, including compilation (5m 21s). This local run was superseded by successful CI, not counted as a completed local suite.

Seams under test: thirdshift metrics text and JSON; Console /metrics local and Fleet views; /api/v1/metrics, all against isolated Command records.

Actual-host acceptance remains unverified: ssh -o BatchMode=yes -o ConnectTimeout=5 lima-thirdshift 'thirdshift --version && thirdshift metrics' exited 255 with Could not resolve hostname lima-thirdshift: Temporary failure in name resolution before running thirdshift.

Visual evidence

Same faux Security and Release records, /metrics?window=all, desktop 1440×900. No layout or responsive behavior changed.

Before — Console Metrics, desktop 1440×900

Before Console Metrics at desktop 1440×900

After — Console Metrics, desktop 1440×900

After Console Metrics at desktop 1440×900

Review coverage

Independent review against refs/remotes/origin/main: Standards 0 actionable findings; Spec 1 acceptance follow-up. Both axes read all four changed files. Unread changed files: none. Generated-output exclusions: none.

Unaddressed findings

  • Standards: none.
  • Spec — actual-host acceptance: Metrics panics on any Security run: COUNTED omits WORK[8] since #2157 #2311 already tracks “thirdshift metrics works on lima-thirdshift.” The SSH run above fails at DNS resolution, so someone with access must check the fixed binary against that machine's retained logs. Local regression, Console, and API checks pass. This operational follow-up remains accepted; no implementation finding was declined and no duplicate issue was filed.
  • Security: none.

Security review outcome

No unaddressed introduced findings.

Merge Danger

Door: two-way

Read-only aggregation and filter choices; no stored records change.

Blast Radius: Metrics

Built with codex codex-cli 0.170.0 · gpt-6.1-sol · xhigh

@JacobStephens2
JacobStephens2 merged commit 9b47cde into main Nov 19, 2026
25 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-2311 branch November 19, 2026 15:59
@JacobStephens2 JacobStephens2 mentioned this pull request Nov 20, 2026
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.

Metrics panics on any Security run: COUNTED omits WORK[8] since #2157

1 participant