Skip to content

refactor: collapse billing intent gate and microsoft recurrence helpers - #4804

Merged
tyler-dane merged 1 commit into
mainfrom
claude/kind-dirac-7yslxf
Oct 24, 2026
Merged

tyler-dane merged 1 commit into
mainfrom
claude/kind-dirac-7yslxf

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

Fixes #

What and why

Debt sweep over the last seven days of merges, after #4795. Four collapses, no product behavior change.

web/billing — one named predicate for the intent-time gate. awaiting-checkout-explore.util.ts existed only to re-export isAwaitingCheckoutWriteLocked under a second name, and its test duplicated the one already in billing-write-lock.test.ts case for case. The four callers each spelled out isBillingWriteLocked() && !defersAwaitingCheckoutGateToCommit(), a compound that reduces to "locked, and not the explore-first status". That is now isWriteLockedAtIntent() in billing-write-lock.ts, carrying the explore-first rationale as its doc comment, so useAppShortcut, useEditSequenceShortcut (twice) and promptShortcutUpgrade read the rule rather than reassemble it. useShortcutWriteLockedAtIntent keeps its own composition because its locked comes from React state, not the module flag; it now calls isAwaitingCheckoutWriteLocked directly. Same leftover-alias shape #4762 removed for billing-write-guard.ts.

sync/microsoft-recurrence — one ordinal BYDAY builder. relativeByDay and byweekdayToTokens each carried the same three-branch ordinal prefixing, in which the ordinal < 0 branch returned exactly what the fallthrough returned. Both now call ordinalDayToken, which states the actual rule (1MO is MO; everything else prefixes). The repeated day.n === 0 ? 1 : (day.n ?? 1) is weekdayOrdinal, and the weekday token list moves up beside the other two day maps instead of being rebuilt on each weekdayToken call.

sync/microsoft-graph-request — drop a re-implemented default. #4785 passed withRetryableProviderHttp an isRetryable identical to that helper's own default, down to the cast. Dropped, with a comment saying why only readRetryAfterMs is Graph-specific.

sync/app.ts — one sweep-wiring helper. The four passive sweeps each repeated build, shutdown.register, start. startSweep does that once; registration still precedes start, and the callers stay in start order, so teardown order is unchanged.

Verify

VERDICT: FAIL on the second strict run, from a single Playwright flake that the same run contradicts.

Checks passed: test:sync:fast, test:web, type-check, lint, knip, test:a11y.

test:e2e reported 296 passed, 3 skipped, 1 failed:

  • e2e/accessibility/datepicker-a11y.spec.ts:17 (dark theme meets baseline accessibility and contrast checks), hover date 29 contrast 1.00:1 for rgb(255, 255, 255) on rgb(255, 255, 255).

That spec is also what test:a11y runs, and test:a11y passed in this same verify invocation; it passes 4/4 on this branch with --repeat-each=2 in isolation. White-on-white at 1.00:1 is the not-yet-painted hover state, and axe logged "background color could not be determined because it is overlapped by another element" across unrelated specs in the same run. The diff changes no CSS, no theme token, and nothing under the sidebar datepicker. Sandbox render-timing flake under full-suite parallel load, not a local blocker; CI decides.

First strict run was VERDICT: INCOMPLETE (Playwright Chromium missing); Chromium was installed and verify rerun, which is the run above.


Generated by Claude Code

Fold the `awaiting-checkout-explore.util` alias into billing-write-lock as
`isWriteLockedAtIntent`, so the four sites that spelled out
"locked and not deferring to commit" share one named predicate instead of a
repeated three-part condition. The deleted module wrapped
`isAwaitingCheckoutWriteLocked` with nothing else, and its test duplicated
the one already in billing-write-lock.test.ts.

In sync, both Microsoft RRULE BYDAY builders repeated the same ordinal
prefixing, where the negative-ordinal branch returned exactly what the
fallthrough did; they now share `ordinalDayToken`. The Graph request passed
an `isRetryable` identical to withRetryableProviderHttp's own default, and
the four passive sweeps each repeated register-then-start wiring.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AJ9cgZRKijHXqSgWHPSD7T
@tyler-dane
tyler-dane marked this pull request as ready for review October 24, 2026 10:32
@tyler-dane tyler-dane added the agent-automerge Agent-loop finished; merge-guard may squash-merge label Oct 24, 2026 — with Claude
@tyler-dane
tyler-dane enabled auto-merge October 24, 2026 10:32
@github-actions

Copy link
Copy Markdown
Contributor

Boot bundle: 527.4 KB gzip (+0.0 KB vs main)

@tyler-dane
tyler-dane added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit af1dcc3 Oct 24, 2026
37 checks passed
@tyler-dane
tyler-dane deleted the claude/kind-dirac-7yslxf branch October 24, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-automerge Agent-loop finished; merge-guard may squash-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants