Correct the Ward Flow pinned-clock record and defend the fix at screen level - #2522
Conversation
#YTR84P said the WardFlowProvider `initialNow` fix existed only on an unpushed Windows branch and had to be re-applied. It does not. An equivalent fix is already on `main`: the render body uses the pinned instant verbatim, and `tests/ward-flow-provider.dom.test.tsx` pins 07:30 and 21:05 to prove it. So the work here is the record and the guard, not the fix. Three things were teaching or claiming the wrong state. The regression vector is two documents, not the source. The Phase 3 plan and its task-4 brief both still present the buggy clock as the build instruction, so anyone rebuilding the provider from them reintroduces the defect. The snippet stays -- it is the historical record of what was actually instructed -- and each now carries a correction block above it naming the defect and pointing at the shipped implementation. The handover document asserted "Nothing here is on `main`", which invites a session to cherry-pick an applied commit. Rewritten against what the tree actually holds: the fix and where it lives, the redundant branch closed out, the blast radius corrected from 40 call sites to 51, and the Phase 6 branch recorded as reachable by fetch rather than workstation-only. The remaining Phase 6 action turned out not to be a test at all. The ledger asked for a D5 pre-08:00 test rendering `MorningPage` inside a pinned provider. That cannot pass: owner decision WB-DB-11 removed the fixed/live split, so `NoHandoverYet` -- which holds the sentence the test would assert -- is exported and rendered by nothing. D5 now needs a decision (retire it, or restore the fixed view) before any test can exist. Recorded, with the separate unlogged breakage it implies for `tests/ui-ward-morning.spec.ts`, whose clicks target controls the page no longer renders. Finally, the fix was undefended at screen level: `releaseBand`'s two `now`-dependent branches were reachable only by calling the pure function directly, so nothing would catch the defect returning through a real component. Two tests in `tests/ward-discharge-board.dom.test.tsx` now drive both through a rendered board -- a same-day clock move flipping a band, and a next-operating-day clock dropping yesterday's released row. Mutation-proven: with the defect reintroduced both go red while all six pre-existing tests in the same file stay green, which is the point twice over. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NiskRgeXeNRiU3npGP4M9f
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_30c397b1-15b8-4682-a087-e612b8eda37e) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 869880bda6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex review (P2) on this PR: the corrected status banner and the introduction directly below it gave a reader mutually exclusive instructions. The banner says the fix is on `main` and must not be cherry-picked; the introduction still said it "lives on a branch nobody else can see" and was needed by Phase 6 — which would send someone back to the very branch the revision retires. Correct, and exactly the defect class this PR exists to close, so the introduction is rewritten rather than patched: the file's job is no longer to rescue stranded work, it is to stop settled work being redone. Two more of the same kind, found re-reading the whole document rather than only the flagged lines: - §1 asserted every `initialNow=` call site passes `NOW_ANCHOR`, which §3 corrects to 51 sites with four deliberately pinned elsewhere. Put into the past tense and pointed at the current figure. - The Phase 6 spec read instruction omitted the `origin/` prefix, so the `git show` it gives fails in exactly the fresh clone it is written for. Also repoints §1's cross-reference, since §4 no longer describes the workaround inline but under its own heading. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NiskRgeXeNRiU3npGP4M9f
|
Codex's P2 on The finding: the corrected status banner and the introduction below it gave a reader mutually exclusive instructions — the banner says the fix is on Re-reading the whole document rather than only the flagged lines turned up two more of the same kind:
Verified after the change: Generated by Claude Code |
Summary
The task this branch started from asked for a lost fix to be re-implemented. It turned out the fix is already on
main, so this PR corrects the record instead and adds the guard that was genuinely missing.#YTR84Pwas stale in four ways. TheWardFlowProviderinitialNowfix is onmain—src/components/ward-management/ward-flow-provider.tsxuses the pinned instant verbatim, andtests/ward-flow-provider.dom.test.tsxalready pins 07:30 and 21:05 to prove it. The unpushed Windows branchclaude/serene-heyrovsky-7a5e53is redundant. The Phase 6 morning page is not onmainat all. The blast radius is 51 provider call sites across 20 test files (47 passingNOW_ANCHOR, 4 deliberately not), not the recorded 40.The real regression vector was two documents, not the source.
docs/superpowers/plans/2026-08-19-ward-flow-phase-3-role-screens.mdanddocs/ward-flow-phase-3-workspace/task-4-brief.mdboth still present the buggy clock (const elapsed = initialNow !== undefined ? 0 : …) as the build instruction, so anyone rebuilding the provider from them reintroduces the defect. The snippet is kept — it is the historical record of what was actually instructed — with a correction block above it naming the defect and pointing at the shipped implementation.docs/ward-flow-pinned-clock-handover.mdis rewritten to be true. Its banner read "Nothing here is onmain", which invites a session to cherry-pick an applied commit.The remaining Phase 6 action turned out not to be a test. The ledger asked for a D5 pre-08:00 test rendering
MorningPageinside a pinned provider. That cannot pass: owner decision WB-DB-11 removed the fixed/live split onclaude/ward-flow-phases-6-7-design, soNoHandoverYet— which holds the sentence such a test would assert — is exported and rendered by nothing. D5 now needs a decision before any test can exist. Recorded, along with a separate unlogged breakage it implies:tests/ui-ward-morning.spec.tsclicks controls the page no longer renders.Two screen-level tests in
tests/ward-discharge-board.dom.test.tsxdrivereleaseBand()'s twonow-dependent branches through a rendered board — a same-day clock move flipping a band, and a next-operating-day clock dropping yesterday's released row. Before this, those branches were reachable only by calling the pure function directly, so nothing would have caught the defect returning through a real component.One immutable ledger inbox request correcting
#YTR84P. Left open, not closed, because the D5 decision is real and untaken. Runnpm run issues:reconcileafter this lands.scripts/check-docs-links.mjs: the existing Phase 6 allowlist entry for the handover doc gains four more branch-only paths, which is what makes the findings above checkable rather than asserted.Verification
npm run verify:pr-local— every selected gate green.lintandtypecheckare reused receipts (exit 0 on this exact content, not fresh runs this invocation);format:changed,docs:check-links,check:ledger-write-discipline,check:outstanding-issues,check:branch-review-ledger,check:rag:fixtures,check:medication-interactionsandcheck:medication-lexicon-reportall ran fresh and passed.Full unit suite:
Tests 2 failed | 12052 passed | 4 skipped (12058).Both failures are environmental, not this diff.
tests/clinical-hazard-controls.test.tsandtests/rag-plan-package-parity.test.tsresolve historical commits (883f1007a,f3d1a3cce) that were absent because this container's clone is shallow. Aftergit fetch --deepen=2000both pass:This diff touches no input either test reads. CI clones fully, so neither should appear there.
Mutation-proven, which is the evidence that matters here. With the defect reintroduced on the provider (
? NOW_ANCHORin place of? initialNow), both new tests go red while all six pre-existing tests in the same file stay green:That is the point twice over: the new tests detect the defect, and the suite already there demonstrably could not, because every one of its renders pins
NOW_ANCHOR. The provider was restored and the file re-run:Tests 8 passed (8).npm run ensure, no Playwright.Risk and rollout
scripts/check-docs-links.mjs, and only to widen an existing allowlist for paths that live on another branch.Clinical Governance Preflight
Not applicable and deliberately left unchecked rather than ticked through. This diff touches no ingestion, answer generation, search/ranking, source rendering, document access, privacy, production environment, or clinical output path. The one behavioural surface it tests, the ward-flow discharge board, is synthetic design scratch under
src/app/mockups/ward-flow/**, which 404s in production.Notes
Follow-ups, both recorded in the ledger request rather than left in chat:
claude/ward-flow-phases-6-7-design— retire D5 with the fixed view, or restore the fixed view and then test it. Worth weighing against that branch's state: PR Ward Flow — synthetic bed-flow prototype (DRAFT, not for merge) #2466 was closed unmerged, 299 commits ahead ofmain.claude/serene-heyrovsky-7a5e53can be closed from the workstation that holds it; it is not visible from any cloud session and its content is superseded.🤖 Generated with Claude Code
https://claude.ai/code/session_01NiskRgeXeNRiU3npGP4M9f
Generated by Claude Code
Note
Low Risk
No production or provider source changes; only docs, one ledger inbox JSON, link-check allowlist, and ward-flow DOM tests on mockup scratch that 404s in production.
Overview
This PR does not re-implement the
WardFlowProviderpinned-clock fix — it is already onmain. It corrects documentation and tracking that still described cherry-picks and a failing D5 test, and adds regression coverage the existing DOM suites could not provide.Documentation rewrites
docs/ward-flow-pinned-clock-handover.mdso the status banner matches reality (fix onmain, redundant local branch, updatedinitialNowblast radius). Correction callouts are added above the historical buggy clock snippets in the Phase 3 plan and task-4 brief so rebuilds do not re-teachelapsed = 0when pinned. An outstanding-issues inbox update for#YTR84Precords that the remaining work on Phase 6 is an owner decision on spec D5 (WB-DB-11 removed fixed/live UI), not a provider test.Tests:
tests/ward-discharge-board.dom.test.tsxgains two renders that assert Expected band labels and Released today grouping change wheninitialNowmoves offNOW_ANCHOR— catching#YTR84Pthrough a real screen where every other suite pins the anchor.Tooling:
scripts/check-docs-links.mjswidens the handover doc’s scoped allowlist for paths that exist only onclaude/ward-flow-phases-6-7-design, keeping link checks honest while citing branch evidence.Reviewed by Cursor Bugbot for commit 869880b. Configure here.