Repository navigation
refactor: keep dashboard migration guards at repair boundary - #183153
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR moves dashboard migration eligibility coverage from a private predicate to persisted-row repair tests. Example: Doctor encounters an older dashboard root with no chatType.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR usefully removes a test-only export while preserving migration eligibility and Doctor wiring; no actionable defect was found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherDoctor scans persisted session rows and delegates eligible dashboard chat-type backfills to the shared session repair owner. flowchart TD
A[Doctor session health] --> B[Dashboard chat type repair]
B --> C[Internal eligibility predicate]
B --> D[Shared session row repair]
D --> E[Session SQLite rows]
B --> F[Repair summary]
Technical reviewBest possible solution: Keep the predicate internal and retain persisted-row eligibility coverage alongside the distinct Doctor orchestration check. Do we have a high-confidence way to reproduce the issue? This PR claims no runtime bug; source inspection confirms the removed export served the former direct predicate tests. Is this the best way to solve the issue? The change uses the existing repair owner and legacy-row fixture, preserves every former exclusion, and retains a separate check for Doctor wiring without adding production machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b2712721b86b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource 0, Tests +65. Total +65 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 24, 2026, 10:53 PM ET / October 25, 2026, 02:53 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Simplified: Kept the dashboard migration predicate internal while preserving its persisted-row guards and Doctor repair wiring. |
…w#183153) Keep the dashboard chat-type migration predicate internal while preserving every eligibility guard through persisted-row repair tests and the full Doctor preview/fix path.
Release adaptation of 50b532d (#183153). The backport of #182345 (51f63cb) exported isUnstampedDashboardRoot only for its unit test. Main made it private and drove the eligibility cases through repairLegacyDashboardChatTypes using a canonical-repair fixture this branch does not carry. Keep every accepted and rejected row case, now asserted through the repair boundary with the branch's session accessor.
…eadcode after backports (#187570) * refactor: keep Teams allowlist sentinel private (#185484) The Microsoft Teams fail-closed allowlist sentinel now remains module-private while preserving its exact restrictive projection and lifecycle coverage. (cherry picked from commit 59b1ddd) * test: teach the live-wrapper fake Bun to answer --revision Partial cherry-pick of the test/scripts/test-live.test.ts hunk only. #173807 (backported as e72f868) made the CI Bun --revision probe mandatory; the fake Bun fixture must answer it from the checkout pin. (cherry picked from commit 08dd80a) * test(ci): expect watchdog exit 124 from wedged run-tsgo #184639 (backported as d9a91b5) intentionally changed the run-tsgo watchdog exit from 1 to 124 so CI collectors stop admitting work. Main realigned this case in run-tsgo-worktree.test.ts (9b14a38); on the release branch the same watchdog case lives in run-tsgo.test.ts and was not realigned by the backport. * test(vitest): keep gateway database-worker routes in canonical order The beta.5 adaptation of #178415 (23a2bcd) prepended three integration proofs to gatewayDatabaseWorkerTestFiles. Canonical project ownership compares that list against sorted discovery, so the out-of-order entries failed vitest-cli-ownership. Move them to their sorted positions; routing membership is unchanged. * refactor: keep Slack reconnect policy private (#181690) Keeps Slack reconnect policy details module-private while preserving the exact invalid-auth cutoff, reset, and blocked-status behavior. (cherry picked from commit cd65901) * fix: keep retired Telegram throttler release private Telegram hunk of 09f9ec8 (#183086) only. The release-only test called the private helper directly; its surviving-alias case is already asserted through releaseRemovedTelegramAccountThrottler, so drop the duplicate direct call. (cherry picked from commit 09f9ec8, partial) * refactor: keep Claude partial-message measurement private src/agents/cli-output-stream-limits.ts hunk of 28e2774 (#184686) only; the backport of #184352 left this export without a consumer. (cherry picked from commit 28e2774, partial) * refactor: keep managed plugin cache selector private src/plugins/management-catalog.ts hunk of 2c0c30b (#185269) only; the backport of #184921 left this export without a consumer. (cherry picked from commit 2c0c30b, partial) * refactor(agents): keep requester settle batch callbacks type private The backport of #181260 (2f7589a) moved RequesterSettleWakeParams into the state module, leaving RequesterSettleWakeBatchCallbacks exported only for a test fixture. Main keeps it module-private; type the fixture through RequesterSettleWakeParams instead. * refactor(infra): drop unconsumed streaming UTF-8 decoder The minimal backport of #180861 (8d3183d) added decodeUtf8Chunks as a prerequisite, but its main consumers (streaming state-migration importers) were intentionally not backported, so production Knip flags it. Remove the export and its unit case; decodeUtf8Input is unchanged. * refactor(scripts): keep pinned Bun CI detection private The minimal #172625 backport (e6c3639) deferred the dev-tool, test-runtime and run-format callers that consume isCiEnvironment on main, so the export has no consumer on the release branch. * test(update): drop orphaned recovery version-mismatch fixture The #185692 backport in 39f9bde removed the last consumer of recoveryVersionMismatch from update-cli.plugin-convergence.test.ts. Main removed the same fixture in eae9bc4 (#181717). * test(gateway): type config removal mocks through inline module imports The release adaptation of #152052 (41aa7a6, de41770) typed its partial mocks through type-only namespace imports. Knip treats the secrets runtime namespace as the only consumer of its exports, so the full-tree scan reported prepareSecretsRuntimeSnapshotRestore and SecretResolverWarning as unused. Use main's inline typeof import() form. * refactor(shared): drop unconsumed async-store helper The backport of #179213 (6d9852d, plus f3fb0e9 registering it as a wrapper component) took the runWithAsyncStore helper and its test without the plugin-instance-invocation consumer, leaving src/shared/async-store.ts unused in production. Remove the helper, its test and its wrapper-components entry rather than complete a perf change during beta stabilization. * chore(knip): model backported perf scripts and Telegram worker fixture Mirror main's Knip entries for files added by beta.5 backports: - scripts/perf/{node-event-session-source-measure.mjs, stream-dispatch-scope-measure.ts,system-prompt-report-retention.ts} as path-invoked script roots (#183931, #183552, #183010); - the Telegram ingress context Worker fixture loaded by URL (#178909) in production ignoreFiles. Also register scripts/test-security-mail-parser.mjs, the standalone nodemailer sender-parsing regression added by #187301 (release-only). * refactor(doctor): keep dashboard migration guard at the repair boundary Release adaptation of 50b532d (#183153). The backport of #182345 (51f63cb) exported isUnstampedDashboardRoot only for its unit test. Main made it private and drove the eligibility cases through repairLegacyDashboardChatTypes using a canonical-repair fixture this branch does not carry. Keep every accepted and rejected row case, now asserted through the repair boundary with the branch's session accessor. * test(agents): hold requester preparation for the settle capacity case after #181260 backport Backport 2f7589a (#181260) filters delivered child findings from settle wakes (needsRequesterSettleFindings), so this delivered-row case no longer reads the child transcript where it injected worker capacity and failed with 'expected findTranscriptEvent to be called'. Main realigned the same case in 411b2e6 (#178104): inject capacity at captureRequesterSessionEntryCurrent and assert the delivered result is not repeated in the resumed wake. Apply that realignment; the 'Already delivered child results' wording that main also asserts belongs to #178104's message change, which this branch does not carry. (adapted from commit 411b2e6) --------- Co-authored-by: Shakker <[email protected]>
What Problem This Solves
The legacy dashboard chat-type migration is currently guarded by tests that import its private predicate directly. That test-only import forces the predicate to remain exported and proves the decision in isolation instead of proving how the Doctor repair scans and rewrites persisted session rows.
User Impact
There is no user-visible runtime change. Existing dashboard roots remain eligible for the same
chatType: "direct"backfill, and every existing exclusion—including spawned, forked, plugin-owned, incognito, externally routed, mis-parented, and non-dashboard rows—remains protected.The change does not alter configuration, SQLite schemas or stored representations, package/API compatibility, dependencies, permissions, timeouts, or migration order.
Why This Change Was Made
The predicate is now internal to
repairLegacyDashboardChatTypes. Its former direct test matrix is consolidated into the existing database repair test using the repository's legacy-session fixture.That fixture now seeds the complete eligibility and exclusion table as durable rows, previews the repair without mutation, applies the repair, and compares every persisted field. Only the eligible row may gain
chatType: "direct"; a repeated fix must report no work and leave the database unchanged. Default and configured main-session keys run as separate cases in the same fixture, including anagent:opskey that protects agent-relative parent resolution.A second synthetic state retains the existing full Doctor composition proof. It drives
noteSessionTranscriptHealththrough preview, fix, and repeated fix so the migration cannot silently disappear from Doctor orchestration while its lower-level owner tests stay green.Evidence
src/commands/doctor-session-dashboard-chat-type.test.tspassed as one batched test covering default/configured-main eligibility, all 15 exclusions, preview nonmutation, exact stamp-only repair, unchanged fields, note output, idempotence, and the real Doctor preview/fix/repeat composition. Vitest reported 61.61 seconds wall time, with 39% spent in test execution.isUnstampedDashboardRootis absent from every export scan and neither changed file appears as a new unused-file finding.Hosted CI, exact-head automated review, and independent engineering review remain pending on the published head.