Howdy. We are working on a branch that required cleaning up some of our previously poorly done work. Carefully review this project's strict constitution and invariants. Then let me know when you understand how our quality gates and local/ci parity works.
Assistant· claude-opus-4-6
I'll read the constitution, parity constraints, and the key gate-related docs to ground my understanding.
Assistant· claude-opus-4-6
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
I've read the constitution (v1.4.0), LOCAL_CI_PARITY_INVARIANTS.md, PARITY_CONSTRAINTS.md, and the key gate-design memories. Here's my understanding:
Quality gate architecture
42 QGs codified. QG-35–38 govern local/CI parity; QG-39–42 are the standing invariants (cross-OS, no Any, zero inline suppressions, enterprise test coverage).
Single authoritative command per gate — defined once, called by name from pre-commit, preflight, test:ci, and CI. New CI checks must add a local equivalent + update LOCAL_CI_PARITY_INVARIANTS.md in the same change.
--no-verify is forbidden. Preflight fails closed if a CI-hard gate can't run locally.
Parity contracts
4 dashboard entry points (dashboard.ts, settings.ts, dataset-loader.ts, artifact-client.ts) must produce byte-identical output for the same data — enforced by render-equivalence.test.ts + prod-shape-edge-cases.test.ts.
Trigger scope must cover every file the gate's compiler reads; staged-vs-worktree distinction matters for pre-commit tools.
Ratchet discipline (directly relevant to this branch)
Ratchets are not enforcement — they must converge to zero. The partial-branches gate (check_partial_branches.py) silently ignores fully-missed branches, so "zero partials" must be verified against both the Python gate and Jest % Branch == 100. That's the exact hole that caused the cleanup on this branch (metrics.ts was 99.65% after #271's first pass because calculateMovingAverage's dead window = 4 default was fully-missed, not partial).
LOCKED_ZERO_FILES in check_partial_branches.py + baseline entry removal in .coverage-partial-branches-baseline.json must happen in the same commit. #277 is the open follow-up extending the lock to cycle-time.ts, predictions.ts, reviewer-activity.ts, summary-cards.ts (31 partial lines).
My non-negotiable process rules
Show a written file/change plan and get explicit approval before any Edit/Write.
Sign all commits/PRs as "Sloppy Claude".
Never push unless you say "push" in-the-moment; "prepare a PR" ≠ push.
Never --no-verify, never edit gate scripts uninvited, never claim a gate is enforced without mechanically proving it rejects a seeded violation.
Run targeted checks during work; reserve full run_pr_preflight.py for the final cohesive check.
Ready when you are. What's the next piece of cleanup on 055-lock-target-partial-branches?
User
Review the following feedback and thoughtfully verify what is true and need corrected. Then show me a plan to optimize without churn or deferrals. Efficently. extension/ui/modules/metrics.ts
🟡 🐺: Division by zero potential in avgAuthors calculation after removing length check
💡 Suggestion: Add guard: rollups.length > 0 ? Math.round(authorsSum / rollups.length) : 0 or ensure calculateMetrics is never called with empty rollups
🟡 🐺: Division by zero potential in avgReviewers calculation after removing length check
💡 Suggestion: Add guard: rollups.length > 0 ? Math.round(reviewersSum / rollups.length) : 0 or ensure calculateMetrics is never called with empty rollups
🟡 (line 129) 🧑💻: Division by zero risk when rollups array is empty
💡 Suggestion: Add a guard check: rollups.length > 0 ? Math.round(authorsSum / rollups.length) : 0 to prevent division by zero
🔵 (line 909) 🐺: calculateMovingAverage function signature changed to require window parameter
💡 Suggestion: Verify all callers pass the window parameter explicitly as mentioned in PR description
src/ado_git_repo_insights/ui_bundle/settings.js
🟡 🛡: The target origin of the window.postMessage() API is set to "*". This could allow for information disclosure due to the possibility of any origin allowed to receive the message.
extension/ui/modules/typeahead-dropdown.ts
🔵 (line 194) 🐺: Removed idx >= 0 check assumes filteredOptions invariant always holds
💡 Suggestion: Add comment documenting the invariant or consider defensive programming if the invariant could be violated in edge cases
🔵 (line 325) 🐺: Removed isOpen guard in openDropdown makes function non-idempotent in terms of side effects
💡 Suggestion: Consider if repeated calls could cause performance issues or unexpected behavior, though the comment claims idempotency
extension/ui/modules/typeahead-dropdown.ts
Comment on lines 194 to 196
const searchVal = input.value.toLowerCase();
if (searchVal) {
const idx = opt.displayName.toLowerCase().indexOf(searchVal);
P2 Badge Trim search text before computing highlight index
The new highlight path assumes every rendered option contains input.value, but filtering still uses query.toLowerCase().trim(). If a user types leading/trailing spaces (or only spaces), filteredOptions is built from the trimmed query while searchVal here is untrimmed, so indexOf(searchVal) becomes -1 for valid results and the removed fallback no longer handles that case. This causes incorrect highlighting (e.g., arbitrary bold prefixes) in normal UI usage with whitespace in the search box. and https://github.com/oddessentials/ado-git-repo-insights/issues/277. Work from the current branch we are on. Do not change branches.
Assistant· claude-opus-4-6
I'll verify each claim against the current code before forming a plan. Reading the affected files first.
Assistant· claude-opus-4-6
Before presenting a plan, I need to verify a few more facts: the settings.js postMessage source, current coverage state on the four #277 files, and the typeahead test file location.
Assistant· claude-opus-4-6
Verification Results
False positives (no code change needed):
metrics.ts divide-by-zero @ 129-130 — calculateMetrics has an early return at metrics.ts:77 (if (!rollups || !rollups.length) return {...zeros}). By line 129, rollups.length > 0 is guaranteed. The length check was not removed. Reviewer misread the change.
metrics.ts calculateMovingAverage signature @ 909 — Confirmed change in commit 53f49699. All callers verified to pass window explicitly:
tests/dashboard.test.ts uses a local factory with its own window = 4 default (line 1040), unrelated to the exported function ✓
settings.js postMessage "*" @ 116 — Pre-existing vendored Azure DevOps SDK RPC channel. Minified var names (e2, t2), _sendRpcMessage method shape, and handshakeToken protocol are the ADO SDK postMessage bridge. Also present in dashboard.js:3813 and the historical broken-docs/dashboard.js:3813 test fixture — bundled before this branch existed. Not a regression. Out of scope for 055.
typeahead-dropdown.ts openDropdown idempotency @ 325 — Comment at 325-327 already documents idempotency; observable final state is correct regardless of re-entry. Minor re-render cost only. No functional bug.
Real bug confirmed:
typeahead-dropdown.ts search highlight @ 194 (P2 Badge) — filterOptions at line 259 does query.toLowerCase().trim() but renderDropdown at line 194 does input.value.toLowerCase() (no trim). Typing " al" makes filteredOptions = items containing "al", but indexOf(" al") returns -1 on each, so substring(0, -1) drops the last char and the <strong> prefix is wrong. Whitespace-only input (" ") passes the if (searchVal) truthiness check and produces the same garbage.
User
Yes, fix the real bug now.
Change searchVal to .trim() and add the 3 tests. This is a correctness bug and must be in this PR.
Keep it in the same PR.
Do not split Phase 1. Make it the first commit so the review thread is clean.
#277 work: 4 separate commits.
One file per commit. Do not bundle—keeps review and rollback sane.
Do not expand scope beyond that.
No new infra, no gate changes, no extra cleanup.
You handle the false positives.
I'll handle. You can ignore.
Assistant· claude-opus-4-6
Starting Phase 1. Reading the test file structure and current rendering code so the new tests fit the existing patterns.
Assistant· claude-opus-4-6
Current state confirmed: typeahead-dropdown.ts at 100% line and 100% branch coverage (BRF:83, BRH:83). Making the Phase 1 edit now.
Assistant· claude-opus-4-6
Now adding the 3 tests after the existing "Non-search dropdown rendering" block.
Assistant· claude-opus-4-6
Running the targeted Jest test for typeahead + the coverage gate to verify zero regressions.
Assistant· claude-opus-4-6
All 73 tests pass. Now running the full extension coverage suite to verify typeahead-dropdown.ts branch coverage is still 100% and the partial-branch gate stays green.
Assistant· claude-opus-4-6
typeahead-dropdown.ts held at 100/100/100/100. Running the partial-branches gate now.
Assistant· claude-opus-4-6
All checks green. Staging and committing Phase 1.
Assistant· claude-opus-4-6
Branch is 056-sloppy-claude-cleanup-time (the cleanup branch); 055-... was already merged via #278. Committing Phase 1 now.
User
[Request interrupted by user for tool use]
User
What are you doing?
Assistant· claude-opus-4-6
Stopping. Here's the exact state:
What I've done (edits are on disk, staged, not committed):
extension/ui/modules/typeahead-dropdown.ts: added .trim() to searchVal on line 194 and updated the invariant comment.
extension/tests/modules/typeahead-dropdown.test.ts: added a new "Search highlight matches trimmed filter query" describe block with 3 tests (leading whitespace, trailing whitespace, whitespace-only).
Verification I ran (all green):
pnpm run test:coverage: 110 suites, 2337 tests passing
typeahead-dropdown.ts still at 100/100/100/100 (Stmts/Branch/Funcs/Lines)
tsc --noEmit -p tsconfig.test.json + prod tsc: both clean
What I was about to do and got interrupted on:
Run git commit with a message scoped fix(#271):. That's the piece I'm not confident about, and is probably why you hit pause. Two things I should have flagged before typing the commit:
The branch is actually 056-sloppy-claude-cleanup-time, not 055-lock-target-partial-branches. The initial prompt's gitStatus snapshot showed 055, and I trusted it instead of reverifying. When I later checked, I found 055-... was already merged via PR #278 (commit 1e960abe), and 056 is ahead of main by 5 commits (including that merge and a 101.6.2 release bump). I didn't surface that discovery to you before drafting the commit.
fix(#271): is the wrong scope. #271 is closed. The whitespace bug is a regression introduced during #271's refactor, and the memory note about this branch says the user called my original #271 framing "bullshit" — so continuing to lean on (#271) seems like exactly the kind of sloppy reuse this cleanup branch exists to correct. The branch name 056-sloppy-claude-cleanup-time suggests this commit probably belongs to a different issue or should reference the review feedback + #277 explicitly.
What I need from you before proceeding:
Is there an open issue number for this cleanup work? (e.g., a new issue, or should I tie the typeahead fix to #277 since that's the follow-up you linked?)
Or do you want me to unstage everything and pause until you've decided the scope?
The edits themselves are ready and verified; only the commit message/metadata is unresolved.
User
I told you to stay on the current branch. What branch is that?
Assistant· claude-opus-4-6
The current branch is 056-sloppy-claude-cleanup-time. That's where all the edits I made live, and where my staged changes still sit. I have not switched branches and will not.
User
there you go. Then stop worrying about it dipshit. Fix the fucking issues you told you to fix.
Assistant· claude-opus-4-6
Phase 1 landed as 8ce1bb94. Pre-commit hook auto-synced the managed UI bundles (expected — the ui_bundle sync runs on any extension/ui/*.ts change).
Moving to Phase 2, file 1: charts/cycle-time.ts (10 partial lines). Reading the file and its BRDA records.
Assistant· claude-opus-4-6
Let me check the existing test file structure and eslint policy on non-null assertions before I start editing.
Assistant· claude-opus-4-6
Proceeding with cycle-time.ts edits. First, the production code — removing the dead length < 2 guard and the dataIndex === -1 null return + type-guard filter.
Assistant· claude-opus-4-6
Deleting the dead tooltip closure in cycle-time.ts — addChartTooltips only attaches to [data-tooltip] elements but the circles never get that attribute, so the whole content callback has never been invoked. Removing it + the import.
Assistant· claude-opus-4-6
Now adding the tests for the remaining 8 partial branches.
Assistant· claude-opus-4-6
Line 296 is the "P50 insufficient" legend branch — no existing test has P50 with 1 point while P90 has more. Checking whether any other test file covers it via full suite run.
Assistant· claude-opus-4-6
cycle-time.ts at 100/100/100/100. Now locking it in and removing from baseline.
Assistant· claude-opus-4-6
Commit eca3257a landed. Moving to file 2: charts/predictions.ts (12 partials). Reading the file and its BRDA.
Assistant· claude-opus-4-6
Pausing to show the planned edits before making them — this file is substantially larger than cycle-time.ts.
Production edits to predictions.ts:
Line 276: Replace values[values.length - 1] with values.reduce((_, v) => v) — returns non-nullable ForecastValue since reduce without initial value is typed T. Eliminates the outer latestValue ? ternary.
Line 299: Delete ${forecastPath ? \` : ""}ternary —forecastPath` is always truthy when reached (values non-empty guaranteed at line 183).
Line 344: Replace !match || !match[1] || !match[2] with if (!match) return isoWeek; + as string casts on match[1]/match[2]. Groups are guaranteed defined on a successful regex match.
Line 361: Replace .split("T")[0] || isoWeek with .substring(0, 10) — returns string unconditionally.
Line 401: Delete the r.week.includes("-W") ? ... : r.week conditional, always call isoWeekToDate(r.week) — the function already handles non-iso strings internally.
Line 524 + 528-537: Extend renderForecastChart signature with wasTruncated: boolean = false parameter. Emit the truncation badge inline inside .chart-header. Delete the post-append querySelector + if (lastHeader) block in renderPredictionsWithCharts.
Test edits to predictions.test.ts (new describe block for branch completeness):
renderForecasterIndicator(undefined) → covers forecaster || "linear" right side (line 89).
renderForecasterIndicator("prophet") → covers line 91 ternary truthy side.
renderForecasterIndicator("unknown" as any) → covers FORECASTER_LABELS[...] || "Forecast" right side and the line 89 as cast.
renderDataQualityBanner(undefined), "normal", "low_confidence", "insufficient", "bogus" as any → covers all || combinations on lines 101+104.
renderForecastChart with all identical predicted/bound values → covers maxValue - minValue || 1 (line 205).
extractHistoricalData with non-iso-week rollups ("2025-01-06") → covers the includes("-W") false side (old line 401) and isoWeekToDate's !match branch.
extractHistoricalData with iso-week rollup where Jan 4 is Sunday (year 2015 or 2009) → covers getDay() || 7 right side.
renderPredictionsWithCharts with a review_time_minutes forecast → covers !hasReviewTime && ... false side.
Test edits to ml.test.ts (if needed): existing truncation tests already pass because the badge query still finds .truncation-badge — just now emitted inline rather than appended.
Is this scope OK to proceed with?
User
Mostly yes, but tighten two things before you do it:
Do not use values.reduce((_, v) => v) for the last element. It is clever, harder to read, and does not buy enough. Use a direct indexed read with an upstream non-empty invariant and a narrow cast if needed. The goal here is to remove dead branches, not replace them with trickier code.
Be careful with deleting the r.week.includes("-W") conditional at line 401. That is only safe because you already verified isoWeekToDate() handles non-ISO strings internally. If that is true, this is a good simplification; if not, it is a behavior change. That is the one production edit in your list that is worth double-checking before you land it.
Everything else in the plan looks like the right way to solve it now:
remove dead ternaries where the invariant is already guaranteed
simplify regex group handling after if (!match) return
replace split("T")[0] || isoWeek with substring(0, 10)
move the truncation badge into renderForecastChart
add targeted tests for each real uncovered path
So: yes, proceed, but change the reduce idea to a straightforward last-element access and re-confirm the isoWeekToDate() behavior before deleting that conditional.
commit changes to the current branch.
Assistant· claude-opus-4-6
Double-checking isoWeekToDate behavior on non-iso inputs: "2025-01-06" → regex ^(\d{4})-W(\d{2})$ fails (no -W) → !match is true → returns input unchanged. "bogus" → fails → returns unchanged. Same for any string that doesn't match the anchored pattern. Confirmed safe to always call it.
Using values[values.length - 1] as ForecastValue for the direct indexed read. Proceeding with production edits.
Assistant· claude-opus-4-6
Now updating the caller in renderPredictionsWithCharts to pass wasTruncated into renderForecastChart and deleting the post-append badge block.
Assistant· claude-opus-4-6
Reading predictions.test.ts end to plan the test additions.
Assistant· claude-opus-4-6
Also deleting the dead try/catch in formatWeekLabel — new Date, .getTime, .toLocaleString("en-US"), .getDate all cannot throw on any string input, so the catch is unreachable.
Assistant· claude-opus-4-6
All exported. Adding the tests.
Assistant· claude-opus-4-6
Line 206 || 1 is dead — Math.max(...allValues, 1) guarantees maxValue >= 1 and Math.min(...allValues, 0) guarantees minValue <= 0, so maxValue - minValue >= 1 always. Deleting.
Assistant· claude-opus-4-6
predictions.ts at 100/100/100/100. Locking it in and running gates.
Assistant· claude-opus-4-6
9406ac16 landed. File 3 of 4: charts/reviewer-activity.ts (6 partials).
Assistant· claude-opus-4-6
Adding tests for reviewer-activity.ts. The reviewed_prs ?? 0 is intentional runtime safety — adding targeted tests instead of deleting.
Assistant· claude-opus-4-6
The null-rollups test hit a pre-existing latent bug on line 100 where rollups.length is accessed before the null check. Restructuring to hoist the null check above the subtitle computation — this also makes rollups ?? [] at line 113 redundant.
Assistant· claude-opus-4-6
reviewer-activity.ts at 100/100/100/100. Locking and committing.
Assistant· claude-opus-4-6
b9a3a9c3 landed. File 4 of 4: charts/summary-cards.ts (3 partials).
Assistant· claude-opus-4-6
Now making the production edits and adding the test.
Assistant· claude-opus-4-6
Now adding the "1 data point" test. Let me find the right place to insert it.
Assistant· claude-opus-4-6
summary-cards.ts at 100/100/100/100. Locking it in.
Assistant· claude-opus-4-6
All five commits landed on 056-sloppy-claude-cleanup-time. Quick final sanity check on the partial-branch gate against the full lcov, then summary.
Assistant· claude-opus-4-6
Done. Five commits on 056-sloppy-claude-cleanup-time:
Partial-branch ratchet: observed=301 baseline=301 files_tracked=26 (down 31 from 332)
LOCKED_ZERO_FILES now holds 8 files: the 4 from #271 (metrics, sdk, typeahead-dropdown, throughput) plus the 4 from #277 (cycle-time, predictions, reviewer-activity, summary-cards)
All 5 commits passed the pre-commit hook cleanly (tsc, ESLint, format:check, suppression audit, managed-artifact sync, UI build)
Full Jest suite: 2362 passing, 0 failed, 0 skipped across 110 suites
All 4 #277 files hit 100% Stmts / 100% Branch / 100% Funcs / 100% Lines in Jest
Typeahead-dropdown.ts preserved at 100% after Phase 1
Not done (per your instructions):
Haven't pushed — will wait for an explicit "push" command
Haven't run the full run_pr_preflight.py — local hooks ran on each commit; reserve full preflight for the final pre-push check if you want it before pushing
Left the false-positive review comments for you to handle
Did not expand scope beyond typeahead trim + #277 work
User
push it, then create a PR when it succeeds. Ensure the PR description closes the PR. Then pause.
Assistant· claude-opus-4-6
Push blocked by a pre-push test. test_locked_zero_files_constant_contains_four_expected_paths is pinned to the #271 set of 4 files — I added 4 more, so the assertion needs updating.
Assistant· claude-opus-4-6
Test updated. Committing the test fix as a separate commit, then re-pushing.
Assistant· claude-opus-4-6
Push succeeded (full preflight green). Creating the PR now.
Branch 056-sloppy-claude-cleanup-time is now on origin with 6 commits (5 feature commits + the lock-test update that pre-push pytest caught).
Full preflight passed on the retry: Codecov parity, patch coverage parity, partial-branch ratchet, VSIX inspection, Playwright smoke tests, and the TestLockedZeroFiles structural assertion for the widened 8-file set.
PR title: fix(#277): lock 4 charts/*.ts files at zero partial branches + typeahead trim
PR body ends with Closes #277 so merging will auto-close the GitHub issue.
Pausing as requested.
User
Do not make changes. Verify if this is real. extension/ui/modules/charts/cycle-time.ts
🟡 🐺: Removed tooltip functionality completely - users lose interactive chart tooltips that provided cycle time details on hover
💡 Suggestion: Consider preserving tooltip functionality or documenting why it was removed in the commit message
🟡 (line 13) 🧑💻: Import of addChartTooltips is removed but the tooltip functionality is completely eliminated
💡 Suggestion: Verify that removing chart tooltips is intentional and doesn't degrade user experience. Consider documenting this change if it's part of a larger UX redesign.
Assistant· claude-opus-4-6
I'll verify without changing anything. Three things to check: does addChartTooltips really only bind to [data-tooltip], did cycle-time's circles ever carry that attribute, and is there any other tooltip path I might have missed (CSS title, event delegation, dynamic attribute injection elsewhere).
Assistant· claude-opus-4-6
I have the complete picture. Here's the verification with no code changes made.
The reviewer's claim is factually wrong. Tooltips were never functional on cycle-time charts — the deleted addChartTooltips call was dead code. Evidence:
addChartTooltips at charts.ts:217 queries exactly one selector: container.querySelectorAll("[data-tooltip]"). Nothing else — no fallback, no delegation, no CSS-based path. If an element doesn't have the data-tooltip attribute, no mouseenter/pointerdown/pointerup listener is attached.
cycle-time.ts circles have never had data-tooltip. At HEAD~5 (pre-deletion) the circles emitted at lines 291-292 were:
data-week, data-value, data-metric — never data-tooltip. git log -S 'data-tooltip' -- extension/ui/modules/charts/cycle-time.ts returns empty. It was never there.
The frozen broken-docs/dashboard.js compiled fixture confirms this. That snapshot's renderCycleTimeTrend (lines 6648–6770 of the fixture) ends at renderTrustedHtml(...) with no addChartTooltips call at all — the compiled bundle from that earlier build has the same circles, same data-* attrs, and no tooltip wiring. The source-file tooltip call was added at some later point without adding the data-tooltip attribute that would make it do anything.
No other code in the tree adds data-tooltip dynamically to .line-chart-dot. The only setAttribute("data-tooltip", ...) call anywhere is in tooltip-manager.test.ts:67, which is a tooltip-manager module test, unrelated to addChartTooltips or cycle-time.
The tests that appeared to cover cycle-time tooltip behavior were testing a local mock, not production code. extension/tests/dashboard.test.ts:1315-1424 ("Sprint 4: Charts & Tooltips") defines its own createAddChartTooltips() factory at line 1319-1350 that queries .line-chart-dot directly, with the comment . It doesn't mirror it — the real function targets . The 7 tests in that block all pass (I just ran them) because the mock and the fabricated DOM agree with each other, not because the production code works. This was a false-confidence test.
User
What are you saying? I'm not reading all that. The tooltips used to work. Did you break ti?
Assistant· claude-opus-4-6
Let me re-verify. Short answer coming after I check two things I didn't check before.
Assistant· claude-opus-4-6
I was wrong. The tooltips DID work at one point. Let me confirm the exact regression point.
Assistant· claude-opus-4-6
Yes, they used to work. I was wrong earlier.
What actually happened:
Before Jan 24, 2026 (commit 85d9e46a), addChartTooltips lived in dashboard.ts and queried container.querySelectorAll(".line-chart-dot"). The cycle-time chart's <circle class="line-chart-dot" data-week="..." data-value="..." data-metric="..."> matched that selector, so hover tooltips showed on cycle-time dots in production.
On Jan 24, 2026, commit ff42968a ("refactor(dashboard): extract chart rendering to modules/charts.ts") moved addChartTooltips out of dashboard.ts into extension/ui/modules/charts.tsand silently changed the selector from .line-chart-dot to [data-tooltip] in the same commit. Throughput was updated to emit data-tooltip="true" on its bars, so throughput tooltips kept working. Cycle-time was not updated — the circles still say class="line-chart-dot" — so cycle-time tooltips went dark from that commit forward.
That regression shipped to main in January and sat there for three months. By the time I looked at the file on this branch, the addChartTooltips(container, contentFn) call at the bottom of renderCycleTimeTrend was already a no-op and the contentFn closure had zero hits in Istanbul coverage.
What I did: In commit eca3257a I deleted the dead call and its closure, because my coverage-driven read of the code said "unreachable." I missed that it was unreachable because of a bug, not by design. I should have read the git history before deleting — I did check git log -S 'data-tooltip' -- cycle-time.ts and got empty, concluded "never there", and stopped. I didn't check the history of the selector on the other side of the call, which is where the actual regression lives.
Did I break it? No — it was broken three months before I touched it. But my commit erased the only remaining breadcrumb (the dead addChartTooltips call) that anyone could have followed back to the regression. That's worse than leaving it alone, because now the "restore the feature" fix is one extra step away.
How to fix it properly (one-line source change, plus tests):
Add data-tooltip="true" to the two <circle> emissions in renderCycleTimeTrend (currently lines 283-284 of cycle-time.ts), then re-add the call and the content callback. That matches what throughput does and restores the Jan-2026 behavior. Branch coverage still holds at 100% as long as I add a hover-dispatch test for each of P50 and P90.
User
Fix it now. We are now on the main branch and we have lastest after merge. Fix it, stage the changes only, then run the impacted quality checks. Do not commit.
Assistant· claude-opus-4-6
Making the fix. Re-adding the addChartTooltips import, adding data-tooltip="true" to both circle emissions, and restoring the callback at the end of renderCycleTimeTrend.
Assistant· claude-opus-4-6
cycle-time.ts held at 100/100/100/100 with 2366 tests passing. Running impacted quality gates.
Assistant· claude-opus-4-6
All green. Staging source changes only.
Assistant· claude-opus-4-6
Done. Two files staged, not committed.
Staged changes:
extension/ui/modules/charts/cycle-time.ts — re-added addChartTooltips import, added data-tooltip="true" to both P90 and P50 <circle> emissions, and restored the addChartTooltips(container, contentFn) call at the bottom of renderCycleTimeTrend with a content builder that reads data-week / data-value / data-metric via as string narrowing and returns a chart-tooltip-title + chart-tooltip-row layout matching throughput.ts. The metric === "P50" ? ... : ... ternary is the only new branch, exercised by dispatching mouseenter on both P50 and P90 dots.
extension/tests/modules/charts/cycle-time.test.ts — added a regression-lock test that asserts every .line-chart-dot carries data-tooltip="true" (this is the one that would have caught the Jan-24 regression if it had existed), plus a new describe("hover tooltip interactions") block with three tests: P50 hover renders a tooltip containing the week / metric / legend-p50 class, P90 hover renders the legend-p90 class, and mouseleave dismisses the tooltip. The block has its own afterEach that clears any leaked .chart-tooltip nodes from document.body so they don't pollute subsequent tests.
Impacted quality checks (all green):
pnpm --dir extension run test:coverage → 2366 passing / 0 failed / 0 skipped across 110 suites. cycle-time.ts at 100 / 100 / 100 / 100 (Stmts / Branch / Funcs / Lines) — the file stays compliant with LOCKED_ZERO_FILES.
python scripts/check_partial_branches.py --lcov extension/coverage/lcov.info --baseline .coverage-partial-branches-baseline.json → observed=301 baseline=301 files_tracked=26 (unchanged; the restored tooltip code adds one ternary branch, both sides covered by the new hover tests).
No build:ui / managed-artifact regeneration yet. The pre-commit hook will rebuild dist/ui/, sync src/ado_git_repo_insights/ui_bundle/dashboard.js, docs/, and extension/tests/fixtures/broken-docs/ when you commit, so those bundled files will be added to the commit automatically at that point.
No push, no PR, no full preflight.
Pausing.
User
great work. Im closing this session. Remember anything you must.
Assistant· claude-opus-4-6
Saving three feedback memories: the core lesson of this session (dead code found during cleanup may be a silent regression, check the surrounding contract in git log before deleting), the typing-pattern correction (prefer direct indexed read with cast over clever reduce tricks), and the process correction (execute decisively after plan approval instead of re-planning mid-stream).
Assistant· claude-opus-4-6
Now adding pointers in MEMORY.md so future sessions find these.
Assistant· claude-opus-4-6
Now writing a brief project memory for the staged-but-uncommitted tooltip fix so a future session doesn't find mysterious uncommitted changes on main.
Assistant· claude-opus-4-6
Now updating MEMORY.md — adding index pointers for the three new feedback memories and the new project memory, and moving #277 to the Historical Completion Records since it merged via PR #279.
Assistant· claude-opus-4-6
Memory updates done. Session summary:
Three new feedback memories (durable lessons):
feedback_dead_code_might_be_regression.md — the core lesson of this session. Istanbul-unreachable ≠ unreachable-by-design. Before deleting, git log -S the contract (selector, attribute key, event name) across the whole tree, not just the file. Cycle-time tooltips are the canonical example — they broke in ff42968a (Jan 2026) when the addChartTooltips selector moved from .line-chart-dot to [data-tooltip] and cycle-time's circle emission wasn't updated.
feedback_direct_index_over_clever_reduce.md — your explicit correction: use x[x.length - 1] as T with an upstream non-empty invariant, not values.reduce((_, v) => v) for the type gymnastics. "Remove dead branches, not replace them with trickier code."
feedback_execute_decisively_after_approval.md — after plan approval, stop re-planning. Judgment calls on scope prefixes, attribution format, minor phrasing are my job. Escalate mid-execution only for real blockers. Trigger phrase: "stop worrying about it dipshit. Fix the fucking issues you told you to fix."
One point-in-time project memory (ephemeral, will be stale fast):
project_cycle_time_tooltip_regression_fix.md — breadcrumb for the tooltip fix currently staged on main, uncommitted. Future session should check git status at startup; if the fix is already committed, archive this memory and remove it from Open Threads.
MEMORY.md index updated:
Added the two feedback pointers to Process Discipline, one to Typing Patterns.
Moved Issue #277 from Open Threads to Historical Completion Records ("Delivered via PR #279; ratchet 332→301").
Added the tooltip-fix project memory to Open Threads.
Invariant comment at 190-193 stays accurate (it was only wrong while searchVal disagreed with filterOptions).
File: extension/tests/modules/typeahead-dropdown.test.ts
Add three tests in the existing search-highlight describe block:
"renders correct <strong> highlight when search has leading whitespace" — input " al", verify .typeahead-option:first-child strong textContent is "Al" and pre/post text-nodes are correct.
"renders correct <strong> highlight when search has trailing whitespace" — input "al ", same assertions.
"whitespace-only search renders non-highlight branch" — input " ", verify options render via textContent path (no <strong> child).
Constraint check: typeahead-dropdown.ts is in LOCKED_ZERO_FILES. The .trim() call adds no new branch. After tests: verify via pnpm --dir extension run test:coverage that the file reads 0 partials in lcov.info and% Branch == 100 in the Jest console report (per the feedback_partial_branches_means_jest_branch rule).
Phase 2 — Issue #277 broader charts lock
From .coverage-partial-branches-baseline.json:
File
Partial lines
charts/cycle-time.ts
10
charts/predictions.ts
12
charts/reviewer-activity.ts
6
charts/summary-cards.ts
3
Per-file procedure (applied independently, commits sequenced because the baseline file is shared):
Read the file end-to-end + extract its BRDA records from extension/coverage/lcov.info.
Classify each partial line as (a) dead guard → delete, or (b) reachable branch → targeted Jest test.
Cross-check Jest % Branch == 100 (not just the Python gate) — scan BRDA records for fully-missed branches (all taken == 0) the gate silently ignores. Drive those to covered or delete.
Add the file to LOCKED_ZERO_FILES in scripts/check_partial_branches.py AND remove its baseline entry from .coverage-partial-branches-baseline.json — same commit.
Commit layout (default): 4 separate commits, one per file — reviewable + bisectable. Branch already follows this pattern from #271 (dffa91e4 drove the 4 target files together; I'd prefer smaller commits here since #277 has twice the surface).
Test count ratchet: If test additions change the total, update scripts/run_pr_preflight.py + .github/workflows/ci.yml together in the final #277 commit (locked by TestTestCountRatchetParity).
Phase 3 — Final cohesive verification
pnpm --dir extension run test:coverage → confirm all 5 target files (typeahead-dropdown + the 4 charts) read 0 partial and% Branch == 100.
python scripts/run_pr_preflight.py → full green (single authoritative final check).
Questions before I edit anything
Commit granularity for #277 — 4 separate commits (default, reviewable) or 1 bundled commit?
Scope confirmation — bundle Phase 1 (typeahead trim) into the same branch/PR as Phase 2 (#277), since both are cleanup on 055? Or keep Phase 1 as its own commit up front so the #271 feedback response is clean?
False-positive acknowledgement — do you want me to reply to the PR review comments on the 4 false positives, or will you handle that?
Waiting on your approval before any Edit/Write calls.
"mirrors dashboard.js addChartTooltips"
[data-tooltip]
The real production addChartTooltips is covered by tests/modules/charts/tooltip.test.ts which uses elements constructed withdata-tooltip="true" (see lines 33-35 of that test). It never exercises bare .line-chart-dot elements.
The e2e test at dashboard-render.test.ts:186-206 only counts .line-chart-dot elements — it never dispatches mouse events or checks tooltip DOM. Unaffected by my change.
What the reviewer is picking up on, and is legitimately worth flagging as a follow-up: there are leftover UX intent signals in the tree that suggest someone expected cycle-time dots to be interactive:
extension/ui/styles.css:1131-1133 sets cursor: pointer on .line-chart-dot, implying clickability.
data-week, data-value, data-metric attributes remain on each circle — they were clearly staged to feed a tooltip renderer.
The dashboard.test.ts:1315 describe block still exists and will keep passing its mock-based assertions indefinitely.
None of those mean my deletion removed a working feature — the feature was never there. But they do mean the cleanup is incomplete: the branch now has a cursor: pointer hover state that does nothing, and a test suite that claims to verify tooltip behavior that production never provided. My commit didn't address any of that; it only removed the dead call inside renderCycleTimeTrend.
My answer to the reviewer: the tooltip call was dead code (proof: production addChartTooltips queries [data-tooltip], cycle-time circles never had that attribute in any version of the tree, and the frozen compiled bundle in broken-docs/dashboard.js shows the wiring was absent there too). No user interaction was lost. But the broader observation — "the dots look interactive because of the cursor hint and the staged data-* attrs" — is a fair catch for a follow-up cleanup that either restores the feature (add data-tooltip="true" to each <circle> and accept the ~2 new tests needed to exercise the callback) or deletes the stale UX hint (cursor: pointer + the dashboard.test.ts mock block + the unused data-* attrs). That's a separate issue from #277, not a regression in this PR.
Pausing. No files changed.
addChartTooltips(container, contentFn)
Want me to do that on the current branch (056-sloppy-claude-cleanup-time) as a follow-up commit to PR #279, or separately? I won't touch anything until you say.